linux安装mysql出现这个错误不用怕,
解决办法: 重新设置root用户密码
# service mysql stop
# mysqld_safe --user=mysql --skip-grant-tables --skip-networking & //(跳过授权表访问)
# mysql -u root mysql
mysql> UPDATE user SET Password=PASSWORD('newpassword') where USER='root'; 把newpassword改成自己的密码
mysql> FLUSH PRIVILEGES;
mysql> quit
# service mysql restart
# mysql -uroot -p
Enter password: <输入新设的密码newpassword>
mysql> - 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
就可以使用了
本文介绍了一种在Linux环境下解决MySQL密码丢失问题的方法。通过停止MySQL服务并使用特定参数启动来绕过授权表验证,然后更新root用户的密码,最后重启服务即可恢复正常访问。
1万+

被折叠的 条评论
为什么被折叠?



