1

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!

t1f
  • 3,021
  • 3
  • 31
  • 61
Loerpert
  • 23
  • 7
  • 1
    Check that you put in the details correct (that error is most commonly a wrong password) or start reading: https://dev.mysql.com/doc/internals/en/authentication-method.html – t1f Mar 26 '20 at 12:08
  • Thanks! I tried making a new password (less complicated) and that fixed the issue. The password i had before was generated, and i copy pasted it into my code very securely. Very strange. But I'm glad it's solved.. Thanks again for your help. – Loerpert Mar 26 '20 at 12:40
  • Glad it helped. Accept my answer for others to see in the future, if you'd like. – t1f Mar 26 '20 at 12:42

2 Answers2

1

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

t1f
  • 3,021
  • 3
  • 31
  • 61
0

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

Loerpert
  • 23
  • 7