ER_NOT_SUPPORTED_AUTH_MODE Client does not support authentication protocol...

node.js连接mysql出现错误: ER_NOT_SUPPORTED_AUTH_MODE: Client does not support authentication protocol requested by server; consider upgrading MySQL client

node.js连接mysql出现错误: ER_NOT_SUPPORTED_AUTH_MODE: Client does not support authentication protocol requested by server; consider upgrading MySQL client

Currently because of version issues

Solution:

1. Find the bin directory under the MYSQL installation path, here is: C:\Program Files\MySQL\MySQL Server 8.0\bin, and then enter the command line tool, as shown below

Insert picture description here

2. Log in to the mysql database. That continues to command-line tool, type: mysql -u root -p. Then enter the password of your own database, enter the database

Insert picture description here

3. Then enter:

ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY '123456';

The above '123456' is my database password, just change it to your own.

4. Finally, enter the following command, and then press Enter.

FLUSH PRIVILEGES;

Screenshot of the third step and the fourth step:

Insert picture description here

Then you can connect to the database.

Insert picture description here

The graphical interface can connect to the MYSQL database but the password is forgotten. The method to change the password is as follows:

1. Log in to the database on the graphical interface.

2. Find the "user" in the page. Click to select "User".

Insert picture description here

3. Select a user and double-click.

Insert picture description here

Insert picture description here

4. Then change it, save it, and reconnect it.

Guess you like

Origin blog.csdn.net/leilei__66/article/details/110674462