Linux忘记MySQL密码解决方法

版权声明:转载请注明出处 https://blog.csdn.net/baidu_25104885/article/details/90318003

在/etc/mysql/debian.cnf里找到一个user和password使用该账户登录

mysql -udebian-sys-maint -p

登录后

>use mysql;
>update user set authentication_string=password('新密码'),plugin='mysql_native_password' where user='root';

重启mysql后生效

猜你喜欢

转载自blog.csdn.net/baidu_25104885/article/details/90318003