Error: Database connection failed (v2.8.5)

Error: Database connection failed (v2.8.5)

Constance Horne གིས-
Number of replies: 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


དཔྱ་སྙོམས་ཀྱི་སྐུགས་ཚུ།: -
In reply to Constance Horne

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

Rick Jerz གིས-
Particularly helpful Moodlers གི་པར Testers གི་པར

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

In reply to Rick Jerz

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

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.

In reply to Constance Horne

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

Rick Jerz གིས-
Particularly helpful Moodlers གི་པར 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?

In reply to Constance Horne

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

Constance Horne གིས-

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

In reply to Constance Horne

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

Constance Horne གིས-

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

In reply to Constance Horne

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

Rick Jerz གིས-
Particularly helpful Moodlers གི་པར 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?

In reply to Rick Jerz

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

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.

In reply to Constance Horne

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

Rick Jerz གིས-
Particularly helpful Moodlers གི་པར 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.

In reply to Rick Jerz

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

Constance Horne གིས-

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