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
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
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:
Then you can connect to the database.
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".
3. Select a user and double-click.
4. Then change it, save it, and reconnect it.