Ubuntu Xampp MySQL Administrator
Jul 21, 2009 · 1 minute readCategory: mysql
This is post is now quite old and the the information it contains may be out of date or innacurate.
If you find any errors or have any suggestions to update the information please let us know or create a pull request on GitHub
Could not connect to host 'localhost'.
MySQL Error Nr. 2002
Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2)
A nice quick fix for this one. In the terminal run the following two commands and then you should be able to connect fine using localhost as the host and the configured MySQL username and password, probably root and {password}.
sudo mkdir /var/run/mysqld/
sudo ln -s /opt/lampp/var/mysql/mysql.sock /var/run/mysqld/mysqld.sock