mysql8創建用戶


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;

 如果兩次密碼不一致,后面的會覆蓋前面的


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM