当前位置:Gxlcms > mysql > 如何设置mysql的登录密码?

如何设置mysql的登录密码?

时间:2021-07-01 10:21:17 帮助过:85人阅读

设置方法:1、使用“set password =password('你的密码');”命令;2、使用“update user set password=password('你的密码') where user='root';”命令。

mysql设置密码

有很多方法:

1、用root进入mysql后

mysql>set password =password('你的密码');
mysql>flush privileges;

2、使用GRANT语句

mysql>grant all on *.* to 'root'@'localhost' IDENTIFIED BY '你的密码'with grant option ; 
mysql>flush privileges;

3、进入mysql库修改user表

mysql>use mysql;
mysql>update user set password=password('你的密码') where user='root';
mysql>flush privileges;

推荐教程:mysql视频教程

以上就是如何设置mysql的登录密码?的详细内容,更多请关注gxlcms其它相关文章!

人气教程排行