After installing MySQL, use the command login MySQL unexpectedly error, mysql error 1045 (28000): Access denied for user ' root ' @ ' localhost ' (using Password:yse), This error is very depressed, after careful analysis, know that the error and password, may be the password in the configuration of the time of the MySQL exception, so that we do not have the correct password, know the problem, immediately think of the solution, that is, reset a password, the method is as follows
1. First turn off MySQL and set the password
#sudo /etc/init.d/mysql stop #sudo --user=mysql--skip-grant-tables--skip-networking & # sudo -u root mysqlmysql > UPDATE user SET password=password ('pas' where user='root'; MySQL> FLUSH privileges; MySQL
2. Restart MySQL and try to log in
#sudo /etc/init.d/mysql restart #sudo -uroot-p Enter Password: #输入密码, the following shows that the login is normal MySQL
Mysql Error 1045 (28000): Access denied for user ' root ' @ ' localhost ' (using Password:yse) This error is only prompted when using phpMyAdmin login (28000) , at the same time phpMyAdmin will also prompt password error, according to the above method can be set after the new password to login phpMyAdmin
Mysql ERROR 1045 (28000): Access denied for user ' root ' @ ' localhost ' (using Password:yse)