大写的Mx

 

windows下修改mysql的root密码

前提:知道root用户密码

1、cmd登录mysql

mysql -uroot -p;

2、直接修改user表中存储密码的字段

update mysql.user set authentication_string=password('wlcms12!@') where user='root';

注意:5.7版本已经没有password字段,而是使用authentication_string它来存储加密过的密码;

5.7以前的版本可使用:

update mysql.user set password=password('wlcms12!@') where user='root';

3、刷新数据库对象

flush privileges;

4、quit;或者exit;都行

5、重新登录,测试是否已经修改完成。

 

posted on 2020-06-09 10:16  大写的Mx  阅读(103)  评论(0编辑  收藏  举报

导航