I'm currently facing an issue with connecting to the MySQL database from my Express server in cPanel. Both the database and server are located within cPanel. I've already created a user and attempted to connect using localhost, but unfortunately it's not working as expected. Here is the code snippet:
const db = mysql.createPool({
host: "localhost",
user: \\user\\,
password: \\password\\,
database: "ts34mpr_SCMP",
dateStrings: true,
});
Despite ensuring that the user has all privileges and verifying that the username and password are correct, the request does not seem to be reaching the database. Any assistance would be greatly appreciated. Thank you!