首页 > 代码库 > Mysql Access denied for user 'root'

Mysql Access denied for user 'root'

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

技术分享

解决方法

原密码为空,更改root密码

 1 # service mysql stop 2 # mysqld_safe --user=mysql --skip-grant-tables --skip-networking 3  4 # mysql -u root mysql 5   mysql> update user set password=password(新密码) where user=root‘; 6   mysql> flush privileges; 7   mysql> quit 8  9 # service mysql restart10 # mysql -uroot -p11 Enter password: <输入新设的密码>

 技术分享

技术分享

 

Mysql Access denied for user 'root'