close

[Solved] NodeJS/mySQL – ER_ACCESS_DENIED_ERROR Access denied for user ‘root’@’localhost’ (using password: YES)

Hello Guys, How are you all? Hope You all Are Fine. Today I get the following error NodeJS/mySQL – ER_ACCESS_DENIED_ERROR Access denied for user ‘root’@’localhost’ (using password: YES) in javascript. So Here I am Explain to you all the possible solutions here.

Without wasting your time, Let’s start This Article to Solve This Error.

How NodeJS/mySQL – ER_ACCESS_DENIED_ERROR Access denied for user ‘root’@’localhost’ (using password: YES) Error Occurs?

Today I get the following error NodeJS/mySQL – ER_ACCESS_DENIED_ERROR Access denied for user ‘root’@’localhost’ (using password: YES) in javascript.

How To Solve NodeJS/mySQL – ER_ACCESS_DENIED_ERROR Access denied for user ‘root’@’localhost’ (using password: YES) Error ?

  1. How To Solve NodeJS/mySQL – ER_ACCESS_DENIED_ERROR Access denied for user 'root'@'localhost' (using password: YES) Error ?

    To Solve NodeJS/mySQL – ER_ACCESS_DENIED_ERROR Access denied for user 'root'@'localhost' (using password: YES) Error A bit late to talk about it but I guess I found the problem: special chars in password!!! I had a $ in pass. Solution: use escape Ex: te\$t

  2. NodeJS/mySQL – ER_ACCESS_DENIED_ERROR Access denied for user 'root'@'localhost' (using password: YES)

    To Solve NodeJS/mySQL – ER_ACCESS_DENIED_ERROR Access denied for user 'root'@'localhost' (using password: YES) Error A bit late to talk about it but I guess I found the problem: special chars in password!!! I had a $ in pass. Solution: use escape Ex: te\$t

Solution 1

I have the same problem, I solved it by changing the password to empty string.

var mysql = require('mysql');
var connection = mysql.createConnection({
    host: 'localhost',
    user: 'root',
    password: ''
});

Solution 2

A bit late to talk about it but I guess I found the problem: special chars in password!!! I had a $ in pass. Solution: use escape Ex: te\$t

Summery

It’s all About this issue. Hope all solution helped you a lot. Comment below Your thoughts and your queries. Also, Comment below which solution worked for you? Thank You.

Also Read

Leave a Comment