Warning: MySQL Connection Failed: Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (111) in /var/www/html/mywww/do_sql.php on line 13
1) check to be sure that the file /var/lib/mysql/mysql.sock is there,
2)check the permissions to the directory and also on the mysql.sock file. i had this error till i gave full access to the mysql.sock file and read access to the var, lib, & mysql dir, give everything else in the mysql directory full access only to the user that mysql is running as and remove all other permissions.
chmod +rx /var
chmod +rx /var/lib
chmod -R 700 /var/lib/mysql
chmod +rx /var/lib/mysql
chmod 766 /var/lib/mysql/mysql.sock
this may not be the best way to do this and i'd be interested if there are any potential security issues by doing this.