2 years ago
Hello,
I am unable to connect to the database using MySQL Workbench.
One of the error messages is "Failed to connect to mysql at 127.0.0.1:3306 with user root".
Where can I find guidance on how to make this connection correctly?
10 Replies
2 years ago
Help!
2 years ago
127.0.0.1:3306 is a loopback, if you want to connect to the database on Railway then you need to use the host and port along with the credentials of the database you have deployed to Railway.
2 years ago
Even though I'm using data from the mysql.railway.internal DB, I'm still unable to connect. Which items exactly should I use from the variable list?
brody
`127.0.0.1:3306` is a loopback, if you want to connect to the database on Railway then you need to use the host and port along with the credentials of the database you have deployed to Railway.
2 years ago
Even though I'm using data from the mysql.railway.internal DB, I'm still unable to connect. Which items exactly should I use from the variable list?
2 years ago
you need to use the public host and port from the service settings under public networking.
https://docs.railway.com/overview/the-basics#service-settings
brody
you need to use the public host and port from the service settings under public networking. <https://docs.railway.com/overview/the-basics#service-settings>
2 years ago
Strangely, it's not working.
If I use "MYSQLHOST" as "mysql.railway.internal" the error message is "Unable to connect to mysql.railway.internal:3306". If I use "MYSQL_URL" as "mysql://root:oleJuELIRUlOVtxmGmopWDqBmpiXZCdR@mysql.railway.internal:3306/railway" the error message is "Invalid hostname URL.".
brody
Per my previous message, you need to use the public host and port.
2 years ago
I believe I am using the correct references as marked "in red" in the attached image.
Wouldn't these be it?
Attachments
brody
you need to use the public host and port from the service settings under public networking. <https://docs.railway.com/overview/the-basics#service-settings>
2 years ago
Please see my previous message.