Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

Why can't my server connect MYSQL database when I can access and ssh it?

I’m setting up my server and I can connect to the DB using `mysql -u root -p` and by ssh from outside the server.

But I am getting `SQLSTATE[HY000] [1045] Access denied for user ‘root’@’localhost’ (using password: YES)` when I start my server.

I have no clue why this is happening. I am able to ssh and connect with the same password without issue. On my server I am using port 3360 and host 127.0.0.1.

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

I tried reinstalling mysql, changing passwords and using the remote server IP but nothing works. I want my server to have access to the database

>Solution :

  1. Check Password
  2. Check if the User root is allowed to connect
  3. Check the MySQL server configuration file (usually located at /etc/mysql/my.cnf or /etc/my.cnf) for the bind-address parameter. Make sure it is set to 127.0.0.1 or localhost
  4. Check Firewall Settings on spesifically port 3360
  5. Check Error Log in the MySQL data directory,

Maybe this helps

Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading