Unable to Connect to Railway MySQL from External Machine
cjake28
HOBBYOP

a year 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: x emoji 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!

Solved

3 Replies

a year 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 about 1 year 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

cjake28
HOBBYOP

a year 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 about 1 year ago


a year ago

No problem!


Status changed to Awaiting User Response Railway about 1 year ago


Status changed to Solved brody about 1 year ago


Loading...