반응형
MariaDB 풀이 연결을 생성하지 못했습니다.
노드 프로젝트를 2-3분간 실행한 후 1분 정도마다 나타나는 경고/오류 메시지에 직면해 있습니다.온라인으로 검색해 보았지만 이에 대한 해결책을 찾을 수 없었습니다.
pool failed to create connection ((conn=-1, no: 45009, SQLState: 08S01) socket has unexpectedly been closed)
my db.js
const mysql = require("mysql"); //^2.18.1
const mariadb = require("mariadb"); //^2.5.3
const DB_OPTIONS = {
host: "127.0.0.1",
user: "root",
password: "",
database: "test-db",
port: 3306,
minDelayValidation: 5000
};
const connection = mariadb.createPool(DB_OPTIONS);
connection.getConnection().then((conn) => {
console.log("Connected to DB!", conn.threadId);
if (conn) conn.release();
}).catch((err) => {
console.error("Error while connecting to DB", err);
});
module.exports = connection;
test.js
...
let database = require("./../middleware/db");
...
...
try
{
database.query(dbQuery, dbParameters).then((result) => {
...
}).catch((dbCatchErr) => {
...
})
}
catch (catchErr)
{
console.error(catchErr);
}
MariaDB 버전: 10.3.23
언급URL : https://stackoverflow.com/questions/66777706/mariadb-pool-failed-to-create-connection
반응형
'programing' 카테고리의 다른 글
| 데이터베이스 오류: ORA-00911: 잘못된 문자 (0) | 2023.10.04 |
|---|---|
| Jest expect에 맞춤형 메시지를 추가하는 방법은? (0) | 2023.10.04 |
| Windows 인증을 사용하는 WebAPI CORS - 익명 옵션 요청 허용 (0) | 2023.10.04 |
| 엔디안니스 탐지 (0) | 2023.10.04 |
| Wordpress 업로더를 통해 미디어를 업로드할 수 없습니다. (0) | 2023.10.04 |