“PROTOCOL_ENQUEUE_AFTER_FATAL_ERROR” in Node-MySqL

前端 未结 3 1074
陌清茗
陌清茗 2021-01-14 12:59

Hi I am trying to write an Node + Express to provide REST services. Everything goes well when the application starts. However, after several hours, I got an error: \"code\":

3条回答
  •  我在风中等你
    2021-01-14 14:00

    In my experience that problem was due to creating a connection directly (with mysqljs/mysql library, unsing createConnection()) instead of using createPool() that allows to run query() and releases the connection automatically after execution (doing getConnection() + query() + release()).

    Without that the connection is not released and, at the next attempt to query, there happens the fatal error.

    See Pooling Connections.

提交回复
热议问题