In Ubuntu server 12.04, 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 we do not have the correct password, know the problem, immediately think of a solution, That is to reset a password by the following method
1. First turn off MySQL and set the password
#sudo/etc/init.d/mysql stop #sudo mysqld_safe--user=mysql--skip-grant-tables--skip-networking & #sudo mysql-u Root MySQL mysql> UPDATE user SET Password=password (' pas ') where user= ' root '; mysql> FLUSH privileges; Mysql> quit
2. Restart MySQL and try to log in
#sudo/etc/init.d/mysql restart #sudo mysql-uroot-p Enter password: #输入密码, the following shows that the login is OK mysql>
Mysql Error 1045 (28000): Access denied for user ' root ' @ ' localhost '(using Password:yse) This error only prompts phpMyAdmin when using (28000), at the same time, phpMyAdmin will also prompt password error, set by the above method can be used to log in with the new password phpmyadmin
Resolve MySQL ERROR 1045 (28000): Access denied for user