Couldn't connect to database: Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2)

Software error:

Can't call method "prepare" on an undefined value at /var/www/html/space20/modules/BaseDB.pm line 346.

For help, please send mail to the webmaster (webmaster@artopium.com), giving this error message and the time and date of the error.