skip to Main Content

I’m trying to connect my NodeJS application to my remote MySQL Database, but it keeps giving me a 1045 error ('ER_ACCESS_DENIED_ERROR'). From the same workstation, I can connect to the same database through MySQL Workbench perfectly fine.

This leads me to think that the problem was with my NodeJS setup, but copying the database to a local setup and then connecting it, worked just fine. For the sake of testing, I made a DB user with host: %, and from my Node app, I connect to the IP address where the database is hosted. I’m hosting it on my own Centos 7 droplet with my workstation IP whitelisted.

The error message I get is:

"Access denied for user '[the test user I made]'@'[workstation ip]' (using password: YES)"

Any help is much appreciated!

2

Answers


  1. Chosen as BEST ANSWER

    Apparently (atleast I think) the password I used, had forbidden characters in it (not sure which ones). Generating a simpler password solved the issue!


  2. The following error:

    "Access denied for user '[the test user I made]'@'[workstation ip]' (using password: YES)"

    Usually indicates a wrong password.
    Check that you wrote down the correct password and fix it if need be.

    Also good to read about at this point is: https://dev.mysql.com/doc/internals/en/authentication-method.html

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search