Error: Database connection failed (v2.8.5)

Error: Database connection failed (v2.8.5)

de Constance Horne -
Número de respuestas: 11

Our prod instance has failed with this error: Error: Database connection failed

This just began yesterday. So far, we have stopped and restarted Apache and MySQL but this is still occurring.

How do I diagnose this issue? 

No server changes have occurred in months.

Constance


Promedio de valoraciones: -
En respuesta a Constance Horne

Re: Error: Database connection failed (v2.8.5)

de Rick Jerz -
Imagen de Particularly helpful Moodlers Imagen de Testers

Have you tried either restarted your server, or restarted the MySQL server?

En respuesta a Rick Jerz

Re: Error: Database connection failed (v2.8.5)

de Constance Horne -

Restarted MySQL and Apache but nada. Database is responding but web server can't seem to connect. In the process of doing the change control paperwork to restart the server now. Last logged access was 2017-06-05 00:13:24.

En respuesta a Constance Horne

Re: Error: Database connection failed (v2.8.5)

de Rick Jerz -
Imagen de Particularly helpful Moodlers Imagen de Testers

Who (or what company) manages your Moodle and server?  You might need to ask them what has changed.  I don't understand what v2.8.5 is?

En respuesta a Constance Horne

Re: Error: Database connection failed (v2.8.5)

de Constance Horne -

Reboot did not fix anything at all. Still getting the same error.

En respuesta a Constance Horne

Re: Error: Database connection failed (v2.8.5)

de Constance Horne -

We are self hosted. Moodle 2.8.5 (Build: 20150310) is what we are running. We haven't changed anything in months.

En respuesta a Constance Horne

Re: Error: Database connection failed (v2.8.5)

de Rick Jerz -
Imagen de Particularly helpful Moodlers Imagen de Testers

I have to tell you an odd thing that happens to me.  Every 31 days, exactly, my database failed.  And the only way that I could fix it was to go into WHM (cPanel), and restart the MySQL service from WHM's script.  So I do believe that there is something odd.

Do you have WHM (cPanel)?  Do you have a VPS, or when you say "self-hosted" do you mean that your run your own dedicated server?

How do you know that no server changes have occurred?  Do you keep track of the versions of php, MySQL, and Apache that are running?

En respuesta a Rick Jerz

Re: Error: Database connection failed (v2.8.5)

de Constance Horne -

Further trouble shooting has shown the following. 

The server rebooted itself at about 15 minutes after midnight early Monday morning. This caused a cascade of issues.

A prior change from February caused the disconnect. 

The server had been renamed, nic cards reset, but no reboot. The config.php was set to the old server name and so apache & mysql could not connect. A bunch of configuration changes had to be made to re-do the server name change. Now we are back up.

Additional research must determine what caused the server to reboot itself.

En respuesta a Constance Horne

Re: Error: Database connection failed (v2.8.5)

de Rick Jerz -
Imagen de Particularly helpful Moodlers Imagen de Testers

Well, you have a bit of work cut out for yourself.

You might consider installing a brand new copy of Moodle, including a new database and new moodledata folder, as an experiment just to see if Moodle will run on your server.  (You can call these something like moodle_x, moodledb_x, and moodledata_x.)

If the experimental install works, then you know that you should be able to get your old moodle working.  Or you can install your production moodle database and moodledata into a new install.

En respuesta a Rick Jerz

Re: Error: Database connection failed (v2.8.5)

de Constance Horne -

We are up as  I mentioned in the prior post. But thanks for your responses.