2
Your database is not configured properly, or your mainfile.php information is incorrect. I would check both.
If you can see your DB in phpMyAdmin (or whatever) then make sure the paths, directories, username and password are correct on your mainfile.php
If you are running on a shared hosting account, send them a ticket and ask if they are having SQL troubles. They may have restarted the SQL server, or be running a backup preventing access for a few minutes. If it last more then a couple hours and you know for sure your mainfile.php is correct, lean on your host, don't ask them what's wrong, tell them whats wrong.