Node uses knex to connect to mysql, every hour with a high probability of occurrence: read ECONNRESET?

I have a node program that queries the local database every hour and then queries the intranet database again. only appears read ECONNRESET when querying the intranet database.

use npm library knex + mysql2 to connect to the database, knex is configured as follows (connection pooling is used)

require("knex")({
    client: "mysql2",
    connection: {
      host : "127.0.0.1",
      user : "your_database_user",
      password : "your_database_password",
      database : "myapp_test"
    }
    pool: {
      min: 5,
      max: 1000
    },
    acquireConnectionTimeout: 60000,
    asyncStackTraces: false, // 
    migrations: {
      tableName: "knex_migrations" // 
    },
    log: {
      warn (message) {
        console.log("[knex warn]", message)
      },
      error (message) {
        console.log("[knex error]", message)
      },
      deprecate (message) {
        console.log("[knex deprecate]", message)
      },
      debug (message) {
        console.log("[knex debug]", message)
      }
    }
  })
  
show variables like "wait_timeout"; of

mysql is

clipboard.png

that is, 8 hours.

according to this answer: https://stackoverflow.com/a/2.
should not appear read ECONNRESET , mysql the time to close useless connections is 8 hours , and I query the database every hour, there is a high probability of this problem, not to mention that I also use connection pooling. knex must be a connection pool using mysql2 ? Doesn"t the connection pool of mysql2 automatically maintain these connections?


have you solved the above problem?
I have the same problem.


recently encountered the same problem. But when I used knex before, I was fine all the time. The time of the
combination is about the same as that of the landlord, and then after you try to reduce the knex version to 0.13 that you used before, you will be fine
if you meet a friend, you can try

.
MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1b36707-4059f.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1b36707-4059f.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?