mysql - Web App database ECONNRESET -
i have expressjs application hosted on azure web app on enabled.
i using bookshelfjs connect mysql database hosted in virtual server on azure.
after sometime, when call web application below error, told me failed connect database server:
select * `member` `name` = 'alvin' limit 1 -read econnreset"
is related expressjs timeout problem?
according similar issue on mysql giving "read econnreset" error after idle time on node.js server, seems mysql connection issue.
as answer said:
mysql indeed prune idle connections.
please try add pool
setting in mysql connection configuration in knex
. e.g,
var knex = require('knex')({ client: 'mysql', connection: { host : '127.0.0.1', user : 'your_database_user', password : 'your_database_password', database : 'myapp_test' }, pool: { min: 0, max: 7 } });
please refer http://knexjs.org/#installation-pooling more info.
Comments
Post a Comment