登录mysql错误1045

2015-11-20 hfreeze linux

登录mysql时出错

#mysql -u root

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

 

解决方法

1、先进入mysql

#mysql -p

2、进入mysql后添加语句

mysql> set password for 'root'@'localhost'=password('');

mysql> flush privileges;

Powered by emlog