Current CTO exploring entrepreneurship on the side; coach; mentor; instructor.
Dedicated to promoting digital literacy and ideological diversity in tech.
Yes. I can connect to a db located in the server which I connect via ssh and I do this with the same packages. However this time the db is not in the same server as the server I connect via ssh.
Current CTO exploring entrepreneurship on the side; coach; mentor; instructor.
Dedicated to promoting digital literacy and ideological diversity in tech.
So your application is on Server A, which you can ssh into, and your database is on Server B.
You can connect to the database server via MySQL workbench from your local system, and you mentioned you can connect to the database via the command line.
Is the command line connection initiated locally or from Server A?
Where are your servers hosted? Is it a cloud service or custom install?
The command line connection initiated locally. From my local terminal I can ssh into server A and then enter server B. DB on server B is accessible only from server A via login password. The servers are custom install.
Current CTO exploring entrepreneurship on the side; coach; mentor; instructor.
Dedicated to promoting digital literacy and ideological diversity in tech.
It sounds like you're connecting to server A via ssh, then connecting to server B via ssh, and then connecting to the database from the command line on server B.
If this is true, then this won't be an effective troubleshooting step.
Instead, ssh into server A, and then try to connect to the database server (not the computer it's running on) via the mysql command line on server A.
ssh into server A
run mysql -h IP_ADDRESS_OF_SERVER_B -u MYSQL_USERNAME -PPASSWORD
Note that there is no space between the -P and the password. A live example might look like: mysql -h 35.123.0.10 -u myUser -PreallySecurePassword123
If you can connect successfully using the above, then your connection details in your code (through your ORM/DB configuration) are wrong.
If you can't connect using the above, then there are network issues like a firewall that is blocking traffic either incoming or outgoing between server A and server B.
Your next step would be to troubleshoot that by reviewing the networking setup of those two machines, using pings or traceroutes as a starting point.
Yes, it seems the code part has issues. CMD ssh and mysql part were done the way you said and they worked. Thanks a lot and will come back with more questions if needed!
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
Thanks for contact!. I can connect with terminal and mysql workbench but not with node. The db engine is innoDB.
Next most likely culprit would be your ORM configuration. Have you worked with these packages before?
Yes. I can connect to a db located in the server which I connect via ssh and I do this with the same packages. However this time the db is not in the same server as the server I connect via ssh.
So your application is on Server A, which you can ssh into, and your database is on Server B.
You can connect to the database server via MySQL workbench from your local system, and you mentioned you can connect to the database via the command line.
Is the command line connection initiated locally or from Server A?
Where are your servers hosted? Is it a cloud service or custom install?
The command line connection initiated locally. From my local terminal I can ssh into server A and then enter server B. DB on server B is accessible only from server A via login password. The servers are custom install.
It sounds like you're connecting to server A via ssh, then connecting to server B via ssh, and then connecting to the database from the command line on server B.
If this is true, then this won't be an effective troubleshooting step.
Instead, ssh into server A, and then try to connect to the database server (not the computer it's running on) via the mysql command line on server A.
If you can connect successfully using the above, then your connection details in your code (through your ORM/DB configuration) are wrong.
If you can't connect using the above, then there are network issues like a firewall that is blocking traffic either incoming or outgoing between server A and server B.
Your next step would be to troubleshoot that by reviewing the networking setup of those two machines, using pings or traceroutes as a starting point.
Yes, it seems the code part has issues. CMD ssh and mysql part were done the way you said and they worked. Thanks a lot and will come back with more questions if needed!