CentOS命令登录MySQL时,报错ERROR 1045 (28000): Access denied for user root@localhost (using password: NO)错误解决方法
1、停用mysql服务:# /etc/rc.d/init.d/mysqld stop
2、输入命令:# mysqld_safe --user=mysql --skip-grant-tables --skip-networking &
3、登入数据库:# mysql -u root mysql
4、mysql下载失败怎么办mysql> use mysql; 结果如下:
  Database changed
5、mysql> UPDATE user SET Password=PASSWORD('newpassword')where USER='newuser';
结果如下:
Query OK, 3 rows affected (0.00 sec)
Rows matched: 3  Changed: 3  Warnings: 0
mysql> FLUSH PRIVILEGES;
结果如下:
Query OK, 0 rows affected (0.00 sec)
mysql> quit
# /etc/init.d/mysql restart
# mysql -u newuser –p
Enter password: newpassword
mysql><登录成功>

版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系QQ:729038198,我们将在24小时内删除。