Error: Database connection failed

Error: Database connection failed

by Jeff Finnan -
Number of replies: 5

The problem I have run into with my mostly empty site is that, at what appears to be intermittent random times the, site is very slow to load and sometimes I get this message:

Error: Database connection failed.
It is possible that the database is overloaded or otherwise not running properly.
The site administrator should also check that the database details have been correctly specified in config.php

I ran into this when I first trying to install moodle and had to restart several times.

I just set up Moodle in my IX Webhosting account a week ago and have been moodling around a only little bit in my spare time.

http://expedioscientiam.net/moodle/

I am much a novice at dealing with mysql, databases, and all the assorted requirements. I have plodded through the docs, understanding some and experimenting to see what happens when I change some aspect.

I have an .htaccess file in the directory which I have used to adjust some php_etc values as well caching per recommendations in http://docs.moodle.org/en/Performance#Apache_performance . Live HTTP Headers has confirmed the changes.

Is this error above a problem with my host or is there something I can adjust?

I see that someone else has run into this problem http://moodle.org/mod/forum/discuss.php?d=91537

But it looks like he has his own server.

Thanks,

Jeff

PS. Is this the best forum for posting this? I did not think this was a General or Installation problem.
Average of ratings: -
In reply to Jeff Finnan

Re: Error: Database connection failed

by Visvanath Ratnaweera -
Picture of Particularly helpful Moodlers Picture of Translators
Check this http://docs.moodle.org/en/Installation_FAQ#Error:_database_connection_failed

I notice here http://expedioscientiam.net/moodle/ that you've solved the problem.

@MOD
In any case, this topic belongs to the forum "Installation Problems" http://moodle.org/mod/forum/view.php?id=28
In reply to Visvanath Ratnaweera

Re: Error: Database connection failed

by Jeff Finnan -
Thanks for the direction. Yes, my setup has been working this weekend. However, it sometimes randomly occurs. I will study the doc link you sent.

Later,
Jeff


In reply to Jeff Finnan

Re: Error: Database connection failed

by Visvanath Ratnaweera -
Picture of Particularly helpful Moodlers Picture of Translators
if that happens only sporadically, then it is a different story: your database server is having hickups or too slow or flooded with other requests or just angry smile
In reply to Jeff Finnan

Re: Error: Database connection failed

by Ken Wilson -

Jeff

One troubleshooting strategy with random failures is to look at what other processes are being executed by the server at the time of the failures. If, for example, you have a virus scan taking place that is accessing your mysql data directories, this may cause a failure (see this).

Ken

In reply to Visvanath Ratnaweera

Re: Error: Database connection failed

by Ken Wilson -

Thanks Visvanath. Moving this to the Installation Problems forum.

Ken