Original title: Win7mysql Root account login prompt: ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: YES)Solution
ERROR 1045 (28000): Ac... password: YES)This means the password is incorrect , then change the password:
If you are a server, it is windows xp/2000/2003 /nt can use this method to retrieve the lost MYSQLSuper Administratorroot Password
If you use win7 win vista,mysql 5.1 There seems to be no mysqld-nt.exe in the version, so can be directly replaced by mysqld.exe.
1, stop the MYSQL service, CMDOpenDOS window (win7,winVistaright click"Run with an administrator account"), enter net stop mysql
## 2, in CMD In the command line window, enter MYSQLinstallation directory For example, C: \Program Files\MySQL\MySQL Server 5.1\bin
Method: cd\ Press enter and enter: cd C:\Program Files\MySQL\MySQL Server 5.1\bin
# # 3, enter mysqlsafe mode, that is, when mysql After getting up, you can enter the database without entering a password.
The command is: mysqld-nt --skip-grant-tables
(win7 seems to be wrong, I skipped it regardless,)
4 , reopen a CMD command line window, enter ...\bin, and enter mysql -uroot -p, use an empty password to log in MySQL (No need to enter a password, just press return Car)
5
6, refresh the permission table This wayMYSQLSuper administrator account ROOT has been reset, next End it in the task manager mysql-nt.exe This process, restartMYSQL! (You can also restart the server directly) MYSQL
, enter the following command to start Modify the password of the root user (note: there is a " in the middle of the command mysql.user Point”)## mysql> update mysql.user set password=PASSWORD('
New password') where User='root';
mysql> flush privileges;
7, quit
#mysql> quit
After restarting, you can use the newly set ROOT Password loginMYSQL!
The above is the detailed content of Mysql root account login prompt under Win7: ERROR 1045 (28000) solution. For more information, please follow other related articles on the PHP Chinese website!