node.js mysql close aborted connections

When using node.js with node-mysql, you may get aborted mysql connections when stopping the app by CTRL+C or otherwise.

Aborted Connections through phpMyAdmin

This is because the mysql connection idles, and you have to implement a function to quit the connection for mysql not showing it as aborted.

This event is triggered when a SIGINT signal is sent to the node.js proccess, and shuts down itself properly:

Leave a Reply

Your email address will not be published. Required fields are marked *