mysql 5.7 root忘记密码

service mysqld stop
mysqld_safe --skip-grant-tables &

 update mysql.user set authentication_string=password('123qwe') where user='root' and Host = 'localhost';mysql

service mysql restart
set password for 'root'@'localhost'=password('123');

注意密码强度sql

相关文章
相关标签/搜索