这种问题需要强行重新修改密码,方法如下:
/etc/init.d/mysql stop (service mysqld stop )
/usr/bin/mysqld_safe --skip-grant-tables
另外开个SSH连接
[root@localhost ~]# mysql
mysql>use mysql
mysql>update user set password=password("123456") where user="root";
mysql>flush privileges;
mysql>exit
正常启动 MySQL:/etc/init.d/mysql start (service mysqld start)【可选操作】
/etc/init.d/mysql stop (service mysqld stop )
/usr/bin/mysqld_safe --skip-grant-tables
另外开个SSH连接
[root@localhost ~]# mysql
mysql>use mysql
mysql>update user set password=password("123456") where user="root";
mysql>flush privileges;
mysql>exit
正常启动 MySQL:/etc/init.d/mysql start (service mysqld start)【可选操作】
MySQL密码重置

本文介绍了一种通过停止MySQL服务并利用--skip-grant-tables参数绕过权限验证的方法来重置MySQL root用户的密码。
7万+

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



