I hit this error during my ERPNEXT installation process.
Where the MySQL was came with LAMPP installation
thus the mysql.sock is located in ../lampp/var/mysql/mysql.sock
I googled and found this, mysql-install-db-problems as my solution.
The steps :
1. set the environment variable to LAMPP mysql.sock path
$ export MYSQL_UNIX_SOCK='/opt/lampp/var/mysql/mysql.sock'
*) the path may vary make sure you do below steps to get the right path
$ sudo updatedb
$ locate mysql.sock
2. Re-install the MySQLdb
I had this same problem in fedora 19 64bit and the yum reinstall just didn't work.
So i tried to make a symbolic link to LAMPP mysql.sock and turns out work like charm.
# ln -s /opt/lampp/var/mysql/mysql.lock /var/lib/mysql/mysql.sock
Hope it helps and happy coding!