If you receive this error message when connecting to MySQL trough command line on your VPS hosting or dedicated server:
Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock'
Then you have to use the following for access to MySQL -h 127.0.0.1:
mysql -h 127.0.0.1 -u dbuser -p database
If you receive this error message from web script, please check the status of the MySQL server.