3 months ago
I'm having trouble connecting to my Railway-hosted MySQL database from my local machine. I'm using the correct hostname (mysql.railway.internal), username, password, and port, but I keep getting the following error: Error: 2005 (HY000): Unknown MySQL server host 'mysql.railway.internal' (-2)
I can connect to MySQL from my backend hosted on Railway, but not from my local machine. I’ve also tried pinging the database host, but it doesn’t seem to resolve.
Can you confirm if external connections to MySQL are allowed? If not, what’s the recommended way to access my database locally?
Thanks in advance for your help!
3 Replies
3 months ago
Hello,
To access your database locally you need to use the public host and port of the database, this can be found in the service settings under networking.
Best,
Brody
Status changed to Awaiting User Response railway[bot] • 3 months ago
brody
Hello,To access your database locally you need to use the public host and port of the database, this can be found in the service settings under networking.Best,Brody
3 months ago
Hi Brody,
Thank you for your help! I updated my connection settings using the public host and port from the networking section, and it's now working perfectly. I appreciate the quick response!
Best,
cJake28
Status changed to Awaiting Railway Response railway[bot] • 3 months ago
Status changed to Awaiting User Response railway[bot] • 3 months ago
Status changed to Solved brody • 3 months ago