mysql重设密码或1045错误解决办法

技术分享 Story 121浏览 0评论
摘要

mysql重设密码或 1045错误解决办法

mysql重设密码或 1045错误解决办法

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

# /etc/init.d/mysqld restart
# mysql -uroot -p
Enter password:

mysql>

转载请注明:成长的对话 » mysql重设密码或1045错误解决办法