728x90
반응형

다음과 같이 환경설정을 해주자.

 

MariaDB [(none)]> set global interactive_timeout = 180;
MariaDB [(none)]> set global wait_timeout = 180;
MariaDB [(none)]> set global max_connections = 2000;

 

- DB 설정 JSON

var db_info = {
    host: process.env.DB_HOST,
    user: process.env.DB_USER,
    password: process.env.DB_PW,
    port: process.env.DB_PORT,
    database: process.env.DB_DATABASE,
    connectionLimit: 300
}

 

- connection.query 함수를 쓸 경우 

var express = require('express');
var router = express.Router();

var mysql = require('mysql');
var { db_info } = require('../config/database');
const connection = mysql.createConnection(db_info);
728x90
반응형

+ Recent posts