Er_Access_Denied_Error: Access Denied for User ''@'Localhost' (Using Password: No)

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

Using recent MySQL version in package.json solved the problem.

I was using version 2.0.0. I changed the version to 2.10.2.

ER_ACCESS_DENIED_ERROR: Access denied for user ''@'localhost' (using password: NO)

You must create a MySQL user specifically to access the app. Create a user and set a password (do not leave the password null). Do not forget to give this user permission to be able to access the database and tables of app. I hope I have helped.

nodejs express reconnect mysql ER_ACCESS_DENIED_ERROR: Access denied for user ''@'localhost' (using password: NO)

var mysql = require('mysql')
var connection = mysql.createPool({
host: "localhost",
user: "root",
password: "",
database: "dbname",
port : "3306"
})
connection.getConnection((err, connection) => {
if (err) {
if (err.code === 'PROTOCOL_CONNECTION_LOST') {
console.error('Database connection was closed.')
}
if (err.code === 'ER_CON_COUNT_ERROR') {
console.error('Database has too many connections.')
}
if (err.code === 'ECONNREFUSED') {
console.error('Database connection was refused.')
}
}
if (connection) connection.release()
return
})
module.exports = connection

example : https://github.com/vishalims095/nodeJS_Mysql/blob/developer/src/Modules/connection.js

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

Using recent MySQL version in package.json solved the problem.

I was using version 2.0.0. I changed the version to 2.10.2.

Directus ER_ACCESS_DENIED_ERROR: Access denied for user 'root'@'localhost' (using password: YES)

To change the default user password you will need to edit the config.inc.php file located in XAMMP/phpmyadmin/config.inc.php

From

$cfg['Servers'][$i]['auth_type'] = 'config';
$cfg['Servers'][$i]['user'] = 'root';
$cfg['Servers'][$i]['password'] = '';

To

$cfg['Servers'][$i]['auth_type'] = 'config';
$cfg['Servers'][$i]['user'] = 'root';
$cfg['Servers'][$i]['password'] = 'root';

Before you save the file, you will need update the password for root@localhost
Sample Image



Related Topics



Leave a reply



Submit