当前位置:Gxlcms > 数据库问题 > Linux mysql ERROR 1045 解决

Linux mysql ERROR 1045 解决

时间:2021-07-01 10:21:17 帮助过:25人阅读

Linux mysql 5.6: ERROR 1045 (28000): Access denied for user ‘root‘@‘localhost‘ (using password: YES)

[root@DB-Server init.d]# /etc/rc.d/init.d/mysqld stop

[root@DB-Server init.d]# mysqld_safe --user=mysql --skip-grant-tables --skip-networking &

CTRL+C

[root@DB-Server init.d]# mysql -u root mysql

mysql> update user set password=PASSWORD(‘newpassword‘)
    -> where user=‘root‘ and host=‘root‘ or host=‘localhost‘;

mysql> flush privileges;

mysql> quit

[root@DB-Server init.d]# /etc/rc.d/init.d/mysqld restart

[root@DB-Server init.d]# mysql -u root -p
Enter password: (输入新密码即可,有可能要多刷几次)

Linux mysql ERROR 1045 解决

标签:restart   quit   mysqld   for   word   pass   art   network   lin   

人气教程排行