Cannot connect to the database (WordPress)

Hello everyone,

The WordPress site of one of my clients is inaccessible with the following message:

Error establishing a database connection

No changes were made to the site or the hosting before the problem appeared.

After several checks:

  • The database is shown as operational in the OVH client area.
  • The database is normally accessible via phpMyAdmin.
  • The credentials and the MySQL server address in wp-config.php match the OVH information.
  • A test PHP file runs correctly from the hosting.
  • However, a MySQL connection test performed directly from PHP returns this error:

php_network_getaddresses: getaddrinfo for bastards33.mysql.db failed: Name or service not known

I also noticed several FastCGI errors in the Apache logs.

I have seen several incidents reported on the Gravelines data centre, but I don’t know if they could be related. According to the list shown on the OVH site, it would not affect my client’s cluster. That said, I don’t see any other explanation at the moment.

Is anyone else currently experiencing this issue? I’d like to hear your feedback before attempting a backup restoration.

Thanks in advance for your help!

Hello @Bastardchopper

If you haven't changed anything, open an incident ticket through the OVH manager.

Then post the ticket number here

After that, call OVH support at 09 72 10 10 07

Thank you, Gaston.

Ticket number: CS17067186

Solved just now

How @victor_webhosting_in?