#Trying to export an SQL pool to other files

2 messages · Page 1 of 1 (latest)

brisk dragon

what am i doing wrong here?
database.js:

const mysql = require("mysql2");


module.exports = mysql.createPool({
    host: "127.0.0.1",
    user: "root",
    password: "root",
    multipleStatements: true
}).promise()

setup.js:

const con = require("./src/database.js");

this is the file hierarchy:

paper prawnBOT
  • Consider reading #how-to-get-help to improve your question!
  • Explain what exactly your issue is.
  • Post the full error stack trace, not just the top part!
  • Show your code!
  • Issue solved? Press the button!
  • Marked as resolved by OP