mysql 新增用戶 並且對用戶設置權限(root)


新增超級權限並允許遠程訪問

GRANT ALL PRIVILEGES ON *.* TO 'myuser'@'192.168.1.3' IDENTIFIED BY 'mypassword' WITH GRANT OPTION;   
FLUSH   PRIVILEGES; 

 

方法1:

 

方法1:
update mysql.user set authentication_string=password('xxx') where user='root' and Host = 'localhost';
方法2:
mysql> alter user 'root'@'localhost' identified by '123';
方法3:
mysql> set password for 'root'@'localhost'=password('123');

刷新權限
mysql> flush privileges;

 


免責聲明!

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



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