In /lib/setup.php after line 153 (echo '
Error: Database connection failed.
';) place: //[MDL-12049][IJR] this fix resolves a rather awful moodle error msg if(isset($CFG->dberrormsg)){ echo ''.$CFG->dberrormsg.'
'; } else { echo 'It is possible that the database is overloaded or otherwise not running properly.
'; echo 'The site administrator should also check that the database details have been correctly specified in config.php
'; } In /config.php place: $CFG->dberrormsg = 'Database down message goes here.';