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