mysql8 更改root密码(windows)

时间:2021-05-24 07:35:02   收藏:0   阅读:0

1.停止服务 net stop mysql;

2.控制台输入 mysqld --console --shared-memory --skip-grant-tables

3.重新打开一个窗口,进入bin目录下,执行mysql,回车

4.密码置空 update user set authentication_string=’’ where user=‘root’;

5.刷新指令 FLUSH PRIVILEGES;

6.修改密码 ALTER USER ‘root‘@‘localhost‘ IDENTIFIED WITH mysql_native_password BY ‘你的密码‘;

7.关闭所有窗口,重启服务 net start mysql

8.登录验证 mysql -uroot -p;回车输入密码

 

评论(0
© 2014 mamicode.com 版权所有 京ICP备13008772号-2  联系我们:gaon5@hotmail.com
迷上了代码!