如何设置myMySQL数据库的登录密码? MySQL数据库使用教程

凤凰 2021-1-19 72 1/19

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

如何设置myMySQL数据库的登录密码? MySQL数据库使用教程

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的登录密码?的详细内容,更多请关注本站其它相关文章!

- THE END -
Tag:

凤凰

1月19日09:29

最后修改:2021年1月19日
0

非特殊说明,本博所有文章均为博主原创。