Error: getaddrinfo ENOTFOUND whitedark
I am just connecting to mySQL. I installed mysql with npm install mysql
command. This is my code.
var mysql = require('mysql');
var con = mysql.createConnection(
{
host: 'whitedark',
user: 'whitedark',
password: 'password'
});
con.connect(function(err)
{
if (err) throw err;
console.log('Connected');
});
There is this error.
{
errno: -3008,
code: 'ENOTFOUND',
syscall: 'getaddrinfo',
hostname: 'whitedark',
fatal: true
}
Where is wrong? When I typed SELECT User, Host, plugin FROM mysql.user;
I get this response. User = whitedark, Host = %, Plugin = caching_sha2_password, ........, User = root, Host = localhost, Plugin = mysql_native_password.