Unable to Connect to Railway MySQL from External Machine
cjake28
HOBBYOP

2 years 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!

Solved

3 Replies

2 years 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 • over 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

2 years 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 • over 1 year ago


2 years ago

No problem!


Status changed to Awaiting User Response Railway • over 1 year ago


Status changed to Solved brody • over 1 year ago


Welcome!

Sign in to your Railway account to join the conversation.

Loading...