Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/mysql/65.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/.htaccess/5.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Mysql TypeError:无法读取属性'_游泳池';未定义的_Mysql_Database_Express - Fatal编程技术网

Mysql TypeError:无法读取属性'_游泳池';未定义的

Mysql TypeError:无法读取属性'_游泳池';未定义的,mysql,database,express,Mysql,Database,Express,我试图在成功执行查询后释放查询,以防止查询留在池中,但遇到错误 TypeError:无法读取未定义的属性“\u pool” 这是我的连接 const mysql = require('mysql'); const myDB = mysql.createPool({ connectionLimit: 10, host: 'server.address.here', user: 'hmidev', password: 'hmidev', database:

我试图在成功执行查询后释放查询,以防止查询留在池中,但遇到错误

TypeError:无法读取未定义的属性“\u pool”

这是我的连接

const mysql = require('mysql');
const myDB = mysql.createPool({
    connectionLimit: 10,
    host: 'server.address.here',
    user: 'hmidev',
    password: 'hmidev',
    database: 'VD_NEW_WEBSITE'
});

myDB.getConnection((error) => {
    if (error) {
        console.log(error);
    } else {
        console.log(`Successfully connected at VD_NEW_WEBSITE`);
    }
});

module.exports = myDB;
这就是我的数据库的外观:


编辑:添加的图像

您正在本地主机上工作吗? 如果您正在本地主机上工作,
您需要将主机更改为本地主机

您正在使用本地主机吗? 如果您正在本地主机上工作, 您需要将主机更改为本地主机

const mysql = require('mysql');
const myDB = mysql.createPool({
    connectionLimit: 10,
    host: 'server.address.here',
    user: 'hmidev',
    password: 'hmidev',
    database: 'VD_NEW_WEBSITE'
});

myDB.getConnection((error) => {
    if (error) {
        console.log(error);
    } else {
        console.log(`Successfully connected at VD_NEW_WEBSITE`);
    }
});

module.exports = myDB;