When to close MySQL connection using node-mysql?

前端 未结 2 1005
予麋鹿
予麋鹿 2020-12-30 20:59

Currently using: https://github.com/felixge/node-mysql

I have the following code:

var connection = mysql.createConnection({
    host     : \'localhos         


        
2条回答
  •  余生分开走
    2020-12-30 21:19

    I believe the proper way is to just get a connection for your app at startup, and end() it when your app closes.

提交回复
热议问题