One, foreword

This year crazy in love with open source, as long as see good open source project, will disregard everything all right in the research, during the May Day and found a very good about the raise of the open source project, but unfortunately, this project is written in PHP, had not learned PHP, nature of this open source project has no clue, but I had to this project, Decided to pit PHP, and then something happened…

Very quickly, 2 hours to get started with PHP and 2 hours to get started with ThinkPHP, and since I’ve been working on Java, it’s a no-brainer. PHP development environment is PHP, Apache, MySQL and a good IDE, IDE is easy to find, I chose JetBrains PhpStorm, and the other environment is all in one WampServer. Navicat, error start…

2. Misdescription

MySQL: 1045-access deniedfor user 'root'@'localhost'(using password YES)
Copy the code

As shown below:

Third, the cause of the error

WampServer is a PHP development environment in which the MySQL web management software phpMyAdmin has changed the permissions of the root user of the database. Because the default password for phpMyAdmin is empty after the installation is complete.

Fourth, error solution

Recharge the password directly to solve the data error problem.

First, stop the mysql database, which I’m sure you can do. You can either stop it from the admin server or enter net stop mysql in the CMD command window to stop the mysql database.

Mysqld = mysqld = mysqld = mysqld = mysqld

skip_grant_tables
Copy the code

Net start mysql > restart mysql > restart mysql > restart mysql > restart mysql > restart mysql

update user set password=password("root") where user="root";
Copy the code

Of course, I just reset the password to root, which is your own password, but remember the password.

Ini file, remove the skip_grant_tables field and save it. Restart the database again to resolve the error.

Fifth, the question continues

I solved a command window in the fourth perfect start to enter the data of this kind of error, and then when I re-enter Navicat open local established connection, continue to report the same error, error did not solve that is to say, wonder, why the command line can be smoothly operation database is not an error, enter Navicat client error?

After resetting the password due to root permission error, the connection established in Navicat is irreversible.

You can either delete the connection and create a new one. Of course, if you delete the connection, it will not create the database already established. Or you can reinstall Navicat.

Six, the problem again

When the local error was resolved, I opened the phpMyAdmin page and reported a similar but different error. The error was as follows:

1045- Access denied for user 'root'@'localhost'(using password NO)
Copy the code

When I set my phpMyAdmin config file to the same password as my MySQL database, I still reported the same error. After a while, I found a solution on StackOverFlow: You can solve this problem by simply clearing your browser’s Cookie cache. In other words, there is no error in my local configuration, and the reason why I continue to report the error is that the browser has already cached the phpMyAdmin login password in the Cookie.

All right, everything worked out perfectly, for the record.

After we solved this problem, we learned that if we had some mistakes and we thought about them, rather than jumping into them and studying them, we could probably solve them in half an hour, rather than half a day and a half later.

Scan the QR code to follow the wechat official account to learn more