最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

Node.js Mysql:连接失败

运维笔记admin25浏览0评论

Node.js Mysql:连接失败

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

与本文相关的文章

发布评论

评论列表(0)

  1. 暂无评论