I'm building an employee tracker application using node and mysql and I keep getting this error when I run my code in the command line: 'Ignoring invalid configuration option passed to Connection: username. This message is currently a warning, but in future versions of MYSQL2, an error will be thrown if you pass an invalid configuration option to a Connection'
This is my code in JS for the connection. My password is in an .env file
// Connects to database + .env for password privacy
const connection = mysql.createConnection({
host: "localhost",
username: "root",
password: process.env.DB_PASS,
port: PORT,
database: "employee_tracker",
}
);
connection.connect((err) => {
if (err) {
console.log("Error with connection")
} else {
console.log("Connected to Employee Tracker")
}
// Calls Starting Fx that begins program
init();
})
app.listen(PORT, () =>
console.info(`Example app listening at http://localhost:${PORT}`)
);
I'm not really sure what I'm doing wrong. Per a previous stack overflow answer, I attempted to change my username to 'user' with no success. Any help appreciated. Thanks!