mysql中的连接错误太多 - Nodejs& MySQL的?

时间:2018-03-14 12:14:14

标签: javascript mysql node.js database

我在我的应用程序中使用 nodejs-v9.2.0 mysql

错误:

代码:'ER_CON_COUNT_ERROR'

错误:1040

NPM模块:

  1. Mysql

  2. Mysql wrapper

  3. 代码:

    var mysql = require('mysql');
    
    var pool = mysql.createPool({
       canRetry: true,
       database: "dbname",
       host: "host",
       user: "user",
       password: "password",
       connectionLimit: 100,
       supportBigNumbers: true,
       bigNumberStrings: true,
       charset: 'utf8mb4_unicode_ci',
       multipleStatements: true,
       debug: true
       waitForConnections: true,
       queueLimit: 0
    });
    
    pool.on('connection', (connection) => {
       connection.on('error', (err) => {
         connection.release();
       });
    
       connection.on('close', (err) => {
         console.error(new Date(), 'MySQL close', err);
       });
    });
    
    var createMySQLWrap = require('mysql-wrap');
    var sql = createMySQLWrap(pool);
    

    注意:

    我注意到mysql npm github中有一个open issue

    有任何解决此问题的方法吗?

    任何建议都将不胜感激

0 个答案:

没有答案