ER_NOT_SUPPORTED_AUTH_MODE problem in mysql (nodejs)
Node.js Version : v8.12.0 OS : windows 10 express: "^4.16.4", mysql: "^2.15.0"
my code is :
const mysql = require('mysql');
var mysqlconnection = mysql.createConnection({ host:'localhost', user: 'root', password:'password', database:'userdata' });
mysqlconnection.connect((err)=>{ if(!err) console.log('database connected..') else console.log('db not connected \n Error : '+JSON.stringify(err,undefined,2)); }); ............................................................................................................................................................
Error:
.............................................................................................................................................................. While running : node file.js i am getting error like this but user name ,db name and password are correct can any one help me out...?????? Error : { "code": "ER_NOT_SUPPORTED_AUTH_MODE", "errno": 1251, "sqlMessage": "Client does not support authentication protocol requested by server; consider upgrading MySQL client", "sqlState": "08004", "fatal": true }
not sure what the cause is, but looks like changing root user resolves the issue. Please review https://github.com/mysqljs/mysql/issues/1507 for more context
I don't see any issues with node.js here
\o/ \o/ \o/ \o/ \o/ ALTER USER 'root'@'localhost' IDENTIFIED BY ''; ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY '';
ping @PpyMohan
Hey I tried the fix ProjetosApps suggested on linux but it did nothing except giving me an error in my sql syntax.
Error: ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY 'YourRootPasswo' at line 1
@Deniernal354 i think you forgot to put ALTER in front of your query. This is how it should look like: ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY 'YourRootPasswo';
ping @PpyMohan again - is this outstanding?
inactive, closing
Best Solution try this it will resolve:
You got this Error : ER_NOT_SUPPORTED_AUTH_MODE this is error is mentioning when you install sql server you selected"strong authentication", but you set a weak password. You need to reset strong password or need to choose legacy authentication method.
Follow these steps to choose legacy authentication method
You installed mysql server using "mysql installer"
1)open -> "mysql intsaller"
2)press reconfig mysql server
3)select left side "authentication method tab"
4)select radio button -->use legacy authentication method
5)now stop and restart the db
Best Solution try this it will resolve:
You got this Error : ER_NOT_SUPPORTED_AUTH_MODE this is error is mentioning when you install sql server you selected"strong authentication", but you set a weak password. You need to reset strong password or need to choose legacy authentication method.
Follow these steps to choose legacy authentication method
You installed mysql server using "mysql installer"
1)open -> "mysql intsaller"
2)press reconfig mysql server
3)select left side "authentication method tab"
4)select radio button -->use legacy authentication method
5)now stop and restart the db
Thanks a lot, it worked for my using MySQL 8.0.18 with NodeJS
Best Solution try this it will resolve:
You got this Error : ER_NOT_SUPPORTED_AUTH_MODE this is error is mentioning when you install sql server you selected"strong authentication", but you set a weak password. You need to reset strong password or need to choose legacy authentication method.
Follow these steps to choose legacy authentication method
You installed mysql server using "mysql installer"
1)open -> "mysql intsaller"
2)press reconfig mysql server
3)select left side "authentication method tab"
4)select radio button -->use legacy authentication method
5)now stop and restart the db
THANK YOU VERY MUCH IT IS WORKING NOW
"code": "ER_ACCESS_DENIED_ERROR", "errno": 1045, "sqlMessage": "Access denied for user 'root'@'localhost' (using password: NO)", "sqlState": "28000", "fatal": true
Best Solution try this it will resolve:
You got this Error : ER_NOT_SUPPORTED_AUTH_MODE this is error is mentioning when you install sql server you selected"strong authentication", but you set a weak password. You need to reset strong password or need to choose legacy authentication method.
Follow these steps to choose legacy authentication method
You installed mysql server using "mysql installer"
1)open -> "mysql intsaller"
2)press reconfig mysql server
3)select left side "authentication method tab"
4)select radio button -->use legacy authentication method
5)now stop and restart the db
thank you mann,,,its worked,,you r awsome
thanks a lot of