Node.js Mysql:连接失败
我正在尝试将node.js连接到mysql,但失败了,我已经安装了mysql。谁能帮我吗?
const express = require("express");
const mysql = require('mysql');
var app = express();
var mysqlConnection = mysql.createConnection({
host: "localhost",
user: "root",
password: "******",
database: "otablo",
});
mysqlConnection.connect((err)=> {
if(!err)
{
console.log("Connected");
}
else
{
console.log("Connection Failed");
}
})
app.listen(3000);
回答如下:This is the failed answer I receive when I'm trying to connect my