Can’t connect to local MySQL server through socket
CAUTION: Very nerdy stuff below. Non-nerds need not continue. Short answer: Check your disk space. Problem If you’ve ever had this error: Warning: mysql_connect(): Can’t connect to local MySQL server through socket ‘/var/run/mysqld/mysqld.sock’ or it’s command line cousin: ERROR 2002 (HY000): Can’t connect to local MySQL server through socket ‘/var/run/mysqld/mysqld.sock’ You’ll know that googling the problem turns up a number of suggestions to recreate the symlink or to reinstall MySQL. Solution For me, the problem was disk space. One of my log files was HUGE and MySQL wouldn’t start because of it. So I just had to locate the offending file, get rid of it, and MySQL fired right up. If you’re running Ubuntu you can do a little du -s -m * to see a listing of files in any directory that’ll have the file size (in MBs) right next … Continue reading
