ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: NO)
# /etc/init.d/mysql stop
# /usr/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/mysqld restart
搞定!!
# /etc/init.d/mysql stop
# /usr/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/mysqld restart
搞定!!
本文介绍了一种常见的MySQL错误:当使用root用户尝试登录时出现的ERROR1045(28000)错误,并提供了详细的步骤来解决这一问题。通过在MySQL中更新root用户的密码并刷新权限,最终成功解决了登录失败的问题。
1576

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



