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';
Substitute 'root' with your desired username and 'password' with your preferred password.
Remember to activate the changes by issuing the command:
FLUSH PRIVILEGES;
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!