- 编辑配置文件my.cnf
添加一行如下:
skip-grant-tables
- 重启MySQL
service mysqld restart
- 登入MySQL并修改密码
mysql
update mysql.user set authentication_string=password('新密码') where user='root';
flush privileges;
exit;
- 去掉skip-grant-tables这行,并重启MySQL即可。
skip-grant-tables
service mysqld restart
mysql
update mysql.user set authentication_string=password('新密码') where user='root';
flush privileges;
exit;
本文标题:MySQL5.7 重置密码
本文链接:https://www.haomeiwen.com/subject/ccmhcqtx.html
网友评论