I\'m getting this error
ERROR 2002 (HY000): Can\'t connect to local MySQL server through socket \'/var/run/mysqld/mysql.sock\' (2)
even though
Two main reasons:
1) mysql-server isn't installed! You have to install it (mysql-server and not mysql-client) and run it.
2) It's installed by default and running. So, it's not possible to run it again through Xampp or Lampp. You have to stop it: sudo service mysql stop
then you can start it through Xampp. It's possible to check if it's running or not with this code: sudo netstat -tap | grep mysql
If you see a result like this: tcp 0 0 localhost:mysql : LISTEN 1043/mysqld
It means that it's running properly.