欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页  >  数据库

MySQL ERROR 1045 (28000)的解决方法

程序员文章站 2022-05-21 10:58:00
...

ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: NO) # /etc/init.d/mysql stop # mysqld_safe --user=mysql --skip-grant-tables --skip-networking # mysql -u root mysql mysql UPDATE user SET Password=PASSWORD('new

ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: NO)

# /etc/init.d/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';
mysql> FLUSH PRIVILEGES;
mysql> quit