Home > Database > Mysql Tutorial > Why Am I Getting 'ER_NOT_SUPPORTED_AUTH_MODE' When Connecting Node.js to MySQL?

Why Am I Getting 'ER_NOT_SUPPORTED_AUTH_MODE' When Connecting Node.js to MySQL?

Linda Hamilton
Release: 2024-11-09 03:28:02
Original
608 people have browsed it

Why Am I Getting

ER_NOT_SUPPORTED_AUTH_MODE Error Connecting Node.js Server to MySQL Database

In the realm of relational database management, migrating between different database systems can sometimes lead to technical snags. As you encountered when attempting to connect your Node.js server to a MySQL database after uninstalling MariaDB, the message "ER_NOT_SUPPORTED_AUTH_MODE" indicates an authentication protocol mismatch.

To address this issue specifically, consider the following solution for MySQL v8.0:

ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY 'password';
Copy after login

Substitute 'root' with your desired username and 'password' with your preferred password.

Remember to activate the changes by issuing the command:

FLUSH PRIVILEGES;
Copy after login

Once these modifications are implemented, you should be able to establish a successful connection between your Node.js server and the MySQL database.

The above is the detailed content of Why Am I Getting 'ER_NOT_SUPPORTED_AUTH_MODE' When Connecting Node.js to MySQL?. For more information, please follow other related articles on the PHP Chinese website!

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
Latest Articles by Author
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template