mysql忘记密码

在/ect/my.cnf中添加如下:
skip-grant-tables
sudo mysqld restart
mysql回车,进入到sql
>user mysql;
>update user set authentication_string=password('123qwe') where user='root' and Host = 'localhost';
搞定;
删掉skip-grant-tables;
sudo mysqld restart
完事;
原文地址:https://www.cnblogs.com/xiashiwendao/p/7471243.html