解决The specified database user/password combination is rejected: com.mysql.cj.exceptions.CJException: Access denied for user 'root'@'localhost' (using password: YES)问题

The database error was found when py ran the project today, as follows: The specified database user / password combination is rejected: com.mysql.cj.exceptions.CJException: Access denied for user 'root' @ 'localhost' (using password: YES)

The error occurred: 1.py can not connect to the database 2. green cat claw can not connect to the database 3. cmd can open the database

After hours of pondering, come up with the problem! 1. The problem of authority 2. Restart the server 3. Reset the password, etc. can not be solved

Finally, there is no way to uninstall mysql! The control panel is uninstalled, the registry is uninstalled as follows: Run the windows window and enter the regedit path: HKEY_LOCAL_MACHINE \ SYSTEM \ ControlSet001 \ Services \ Eventlog \ Application \ MySQL, the folder is also uninstalled, and can be passed through environmental variables

Look at the path, and by the way, see if C: \ ProgramData \ MySQL has mysql. If it exists, delete it by the way. In short, be sure to uninstall it!

Then I installed the 5.7 version of mysql. During the installation, I found that the port 3306 was occupied. At this point, I suspect that the connection to mysql may not be possible at first.

So now I must solve the problem of this port when installing, otherwise the installation will not work, and there is not much nonsense, the solution is as follows:

First of all, I know how the windows system can check the application process id of a certain port. The command is:

netstat  -aon|findstr 3306

As above, 6848 is the pid

Then, the last value is the process id number. At this time, you need to check which application corresponds to the id number. You can use the command tasklist:

There will be many applications, you need to find the id value found in the PID in that column, look at its corresponding application, then open the resource manager, view the detailed information, find this application (pid), and end the process (do not The end of the command, basically can not be ended)

After ending the process, you can install mysql normally

Then there may be a time zone problem when py connects again, enter the command SET GLOBAL time_zone = '+8: 00';

Summary: This problem may also be a problem with the port. You can check whether the port is occupied first!

Guess you like

Origin www.cnblogs.com/PMXGG/p/12748982.html