Luciano Luciano - 5 months ago 83
MySQL Question

Sequelize.js: how to handle reconnection with MySQL

I've always used Mongo with Node, but now due to an existing datasource I need to connect a node app with Mysql.

Sequelize seems a good solution, but I don't get how to handle connection error, reconnection and re-tries.

To check for connection error on first run


But what if I loose connection and want to reconnect?

Answer Source

There is an open issue for this in Sequelize:

Based on that, this error is handled in sequelize.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download