create user test_user@'%' identified by 'test2022@'; grant all privileges on test.* to test_user@'%' with grant option; flush privileges;
這樣就可以創建一個叫 test_user 的用戶並把密碼設置為 test2022@.
同時授予 它 test 數據庫的所有表權限
刷新權限規則
如果你要修改遠程連接用戶的加密規則 可以用這個
alter user test_user@'%' identified with mysql_native_password by '你的密碼';
flush privileges;
如果兩次密碼不一致,后面的會覆蓋前面的