Are there any problems if we do not close the mysql connection in the mysql node js module

If we do not close or end the mysql connection in node js, these are effects in the function or not.

I do like this

var mysql      = require('mysql');
var connection = mysql.createConnection(...);

connection.query('SELECT 1', function(err, rows) {
  // connected! (unless `err` is set)
});

I do not end the mysql connection with any where in my code. My question is: It is necessary to close the mysql connection. If we do not close the mysql connection, I will encounter any other problems in the future.

Please help me be new to nodejs

EDIT1 I will not encounter problems such as inability to connect, too many connections to open, etc. Does this mean any problems related to resources? to the right.

EDIT2

What instant mysql connection will be close if we don't finish it manually or using the end function?

+5
4

.

, , , .

, , , , - . .

, , , , .

, .. , , , , , , .

+5

, .

0

, , MySQL:

"[host] - , " mysqladmin flush-hosts "

MySQL " ". , FLUSH HOSTS MySQL. , NodeJS.

, db connection.end() connection.destroy()

0

If you ask the question: “Is there any specific cleanup on the mysql side when I tell the server that I am closing the connection”, then the answer is “no”, if you just exit your client process or close the socket, this is same as the calling connection .end () "

0
source

All Articles