Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

ER_NOT_SUPPORTED_AUTH_MODE - MySQL server


Failed at Connecting Node.js Server to MySQL-Database


        I had MariaDB" installed on a "Node.js Server", but decided that I wanted to use a SQL Database instead. I uninstalled, and completely removed "MariaDB", after which, I proceeded to install the "Community Ed." "MySQL Database". After going through the entire *'MySQL Setup Process'**, I made several attempts to connect to the database via a JavaScript document that implemented the de facto code snippet for a JS DB Connection — my DB-connection document is posted as a code snippet bellow — shown in the code snippet bellow. Disappointingly, the JS/SQL connection failed at each attempt.



Here is the Failed Connection Error Message that I received:


 "ER_NOT_SUPPORTED_AUTH_MODE: Client does not support authentication protocol requested by server. Consider upgrading MariaDB client."  



JS/SQL Connection Snippet that I am using:


     var mysql = require('mysql');          var connection = mysql.createConnection({         host     : 'localhost',         user     : 'root',         password : '********',         database : 'foobarDb'     });   
like image 885
João Gouveia Avatar asked Jul 06 '17 10:07

João Gouveia


People also ask

How do I check MySQL version?

To check the version your MySQL is running, type and execute mysql -V (note the uppercase V) in the command line. As you can see, the MySQL version for this system is 10.4.

How do I create a new database in MySQL?

Open the MySQL Workbench as an administrator (Right-click, Run as Admin). Click on File>Create Schema to create the database schema. Enter a name for the schema and click Apply. In the Apply SQL Script to Database window, click Apply to run the SQL command that creates the schema.

What is er_not_supported_Auth_mode error in MySQL?

0 MySQL error: ER_NOT_SUPPORTED_AUTH_MODE: Client does not support authentication protocol requested by server; consider upgrading MySQL client -1 Syntax Error when trying to reset Root password in MariaDB shell

How to solve'client does not support authentication protocol requested?

'Client does not support authentication protocol requested by server; consider upgrading MySQL client Then you are likely in the right place. To solve the problem start by creating an Empty 'dot JS' file for testing, call it 'sqltest.js' or whatever you like.

Does 1717 NodeJS MySQL client support authentication protocol?

17 NodeJS MySQL Client does not support authentication protocol 6 How to connect to MySQL server from Visual Studio Code 1 Node.js + MySQL: Program refuses to connect to remote database with "ECONNREFUSED"

Why can't I install mysql2 with typeorm?

It was because typeorm use mysql inside, mysql2 dose not has this problem Sorry, something went wrong. If you just install mysql2 and not MySQL we will use that instead. No need to hack up your dependencies. This seems to have been resolved in a few different ways so I'll be closing it. Sorry, something went wrong.


2 Answers

For MySQL v8.0 use the following:

ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY 'password' 
like image 81
Archil Labadze Avatar answered Oct 04 '22 17:10

Archil Labadze


enter image description here

You need to reconfigure the Quick Action Settings by clicking the "Reconfigure Link" as shown in the screenshot below. From there, select "Legacy password" for v5.1.


The cause of the error:


You installed the latest "MySQL Version", v8.0. The latest version has a different encryption plugin for authenticating users at login. 5.6, and 5.1 revert to the prior encryption algorithms. Please note, 5.6 & 5.1 have several security vulnerabilities reported by oracle.

like image 28
Vinayak Shedgeri Avatar answered Oct 04 '22 19:10

Vinayak Shedgeri