I’m trying to connect to the WPDB of Local from a Node.js app on my localhost, but I’m getting this error:
...
code: 'ER_HOST_NOT_PRIVILEGED',
errno: 1130,
sqlMessage: "Host '127.0.0.1' is not allowed to connect to this MySQL server",
sqlState: undefined,
fatal: true
}
This is the piece of code that I’m using:
var mysql = require('mysql');
var connection = mysql.createConnection({
host: '127.0.0.1',
port: '10010',
user: 'root',
password: 'root',
database: 'local',
});
connection.connect();