I am getting this error, but none of the solutions worked for me
Error: ER_ACCESS_DENIED_ERROR: Access denied for user ''@'localhost' (using password: YES)
I tried the solutions posted online but they did not work. I can connect to my server in Python, but not in NodeJS despite having the MySQL module installed.
var con = mysql.createConnection({host: "localhost", port: 3306, username: "root", password: "password", database: "activity"})
For some reason, the error message does not show user 'root'@'localhost', but rather an empty user. I do not know why this isn't working, since I am able to connect to my database in python. I've tried flushing privileges and other solutions posted online, but none work. MySQL server does run on port 3306
usernametouserin config