我把本地网站和服务器上的网站都连接到服务器mysql中的某个数据库,几次交替一触登录后,数据库开始报故障:
然后linux后台也无法登录mysql
从网上试了几个方法,都不行,只有一个尚可:
# /etc/init.d/mysql stop
# cd to the mysql installation
# ./bin/mysqld_safe --user=mysql --skip-grant-tables --skip-networking &
# mysql -u root mysql
mysql> UPDATE user SET Password=PASSWORD('newpassword') where USER='root';
mysql> FLUSH PRIVILEGES;
mysql> quit
# /etc/init.d/mysql restart
# mysql -uroot -p
Enter password: <输入新设的密码newpassword>
本文介绍了一种解决MySQL登录故障的方法,特别是当遇到错误1045(拒绝root用户登录)时,通过停止MySQL服务并使用特定参数启动来重置密码。
2472

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



