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

相關文章
相關標籤/搜索