79734353

Date: 2025-08-13 13:48:06
Score: 1.5
Natty:
Report link

If you must use createConnection, you’ll need to handle error events and reconnect on PROTOCOL_CONNECTION_LOST, but pooling is simpler and safer.

you should use connection pooling with mysql2.create.Pool() instead of a single connection.
That way, if one connection closes, the pool opens a new one automatically.

Reasons:
  • No code block (0.5):
  • Low reputation (1):
Posted by: Pritpal Singh