mysql遠程連接權限grant all privileges on *.* to ‘root‘@‘%‘ identified by ‘123456‘ with grant optio語句報錯


這條語句適用於MySQL8.0之前的

而MySQL8.0及之后的,設置遠程連接權限要用下面的語句才可以

create user root@'%' identified by '123456';

grant all privileges on *.* to root@'%' with grant option;

 

1、創建用戶

CREATE USER '用戶名'@'host' IDENTIFIED BY '密碼';

2.授權(全部數據庫權限)

grant all privileges on *.* to '用戶名'@'%' ;

3.刷新權限

flush privileges;


免責聲明!

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



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