root:Error connecting to MySQL database: 2005 (HY000): Unknown MySQL server host
swissmadison
PROOP

2 years ago

im not sure whats wrong as my code was working up until yesterday but today i started getting this error
Error connecting to MySQL database: 2005 (HY000): Unknown MySQL server host 'swi.railway.internal' (-2)

the server is correct
self.connection = mysql.connector.connect(
host=RAILWAYPRIVATEDOMAIN,
user=MYSQLUSER,
password=MYSQLPASSWORD,
database=MYSQLDATABASE
)

9 Replies

brody
EMPLOYEE

2 years ago

Is swi.railway.internal the correct internal domain for the MySQL database?


swissmadison
PROOP

2 years ago

swissm.railway.internal


swissmadison
PROOP

2 years ago

it used to be
mysql.railway.internal but that stopped working for the same reason, so i switched it to swissm.railway.internal and it worked for a bit but then it stopped working again


brody
EMPLOYEE

2 years ago

Please attach a screenshot of the private domain for the MySQL service, not your app's service.


swissmadison
PROOP

2 years ago

attached

Attachments


brody
EMPLOYEE

2 years ago

Then that is what you should be using to connect to your database with.


swissmadison
PROOP

2 years ago

i am
but its not working


swissmadison
PROOP

2 years ago

im not sure whats wrong as my code was working up until yesterday but today i started getting this error Error connecting to MySQL database: 2005 (HY000): Unknown MySQL server host 'swissm.railway.internal' (-2)



Loading...