Home > Database > Mysql Tutorial > body text

Mysql root account login prompt under Win7: ERROR 1045 (28000) solution

PHPz
Release: 2017-03-12 13:49:12
Original
1743 people have browsed it

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

Mysql root account login prompt under Win7: ERROR 1045 (28000) solution

## 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

Mysql root account login prompt under Win7: ERROR 1045 (28000) solution

# # 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)

Mysql root account login prompt under Win7: ERROR 1045 (28000) solution

5
, 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 root account login prompt under Win7: ERROR 1045 (28000) solution

6, refresh the permission table
mysql> flush privileges;
7
, quit

#mysql> quit

Mysql root account login prompt under Win7: ERROR 1045 (28000) solution

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
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!

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!