您的位置:首页 > 数据库 > MySQL

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

2017-02-08 23:14 295 查看
mysql出现这个错误。

解决办法: 重新设置root用户密码

# service 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
# service mysql restart
# mysql -uroot -p
Enter password: <输入新设的密码newpassword>
mysql>


就可以使用了
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签:  mysql
相关文章推荐