정확한 연결 에러 메시지를 같이 첨부해주셔야 오류 해결이 가능합니다.
질문글만으로는 해결해드릴 수 없을 것 같습니다.
저의 node.js mysql 연결 코드는 다음과 같습니다.
// node 20.10.0
// npm - "mysql": "^2.18.1"
import mysql from "mysql";
export const connection = mysql.createConnection({
host: process.env.DB_ADDRESS,
port: process.env.DB_PORT,
user: process.env.DB_ID,
password: process.env.DB_PW,
database: process.env.DB_SCHEMA,
});
connection.connect((err) => {
if (err) {
console.error("error DB connecting: " + err.stack);
return;
}
console.log("DB Connection as ID : " + connection.threadId);
});
48647 INFO: checking EXE
48653 INFO: Rebuilding EXE-00.toc because pkg is more recent
48654 INFO: Building EXE from EXE-00.toc
48663 INFO: Appending archive to ELF section in EXE /workspace/TDCP_51/build/index/index
48695 INFO: Building EXE from EXE-00.toc completed successfully.
48713 INFO: checking COLLECT
WARNING: The output directory "/workspace/TDCP_51/dist/index" and ALL ITS CONTENTS will be REMOVED! Continue? (y/N)y
On your own risk, you can use the option --noconfirm to get rid of this question.
57406 INFO: Removing dir /workspace/TDCP_51/dist/index
57415 INFO: Building COLLECT COLLECT-00.toc
59023 INFO: Building COLLECT COLLECT-00.toc completed successfully.
에러가 딱히 뜨지 않습니다.