var express = require('express');
var mysql = require('mysql');
var connection = module.exports = mysql.createConnection({
host: 'myhost.com',
port:'3307',
user: 'username',
password: 'password',
database: 'mydatabase'
});
connection.connect(function(err) {
if (err){
throw err;
}
else
console.log('You are now connected...');
});
有時當我嘗試連接數據庫時,我讀取ECONNRESET錯誤。請幫忙。我嘗試了很多東西,但似乎沒有任何工作。節點js(Express js)Mysql讀取ECONNRESET錯誤
的可能的複製[節點JS ECONNRESET(http://stackoverflow.com/questions/17245881/node-js-econnreset) –