mysql模块
今天访问了下内网的一台服务器,发现挂掉了,SSH上去看了下nohup.out
,发现报错了12345678events.js:71 throw arguments[1]; // Unhandled 'error' event ^Error: Connection lost: The server closed the connection. at Protocol.end (/var/www/html/utci/node_modules/mysql/lib/protocol/Protocol.js:73:13) at Socket.onend (stream.js:66:10) at Socket.EventEmitter.emit (events.js:126:20) at TCP.onread (net.js:417:51)
这个错误的大概意思就是,未处理的error
事件
原因是:mysql的连接久了以后,超时了。
解决方法是:
增加error
事件的监听
database.js:
|
|
伊泽
2013-07-07于杭州