“PROTOCOL_ENQUEUE_AFTER_FATAL_ERROR” in Node-MySqL

前端 未结 3 1038
陌清茗
陌清茗 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 13:48

    In my Ubuntu I found out that the database had corrupted exactly at 10:02 am from the mysql logs. Exactly at the same time this error message started. So I restarted the Ubuntu.

    After rebooting it still gave same error. Around the time when mysql server turned "ready" it started working. Maybe Mysqld took a couple of seconds to resolve crash or database corruption.

    0 讨论(0)
  • 2021-01-14 13:58

    I was getting this error in my application as well, and ended up raising the amount of available memory to MySQL to fix it. How to set memory limit in my.cnf file

    It was most likely related to having large transactions and running out of memory.

    0 讨论(0)
  • 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.

    0 讨论(0)
提交回复
热议问题