Error Solutions

ERROR 2002 (HY000): Can’t connect to local MySQL server through socket ‘/var/run/mysqld/mysqld.sock’ (2)

A search for references to this error;

ERROR 2002 (HY000): Can’t connect to local MySQL server through socket ‘/var/run/mysqld/mysqld.sock’ (2)

on Google currently returns over 42,600 results implying how much it gets people disturbed.

For most of the cases, people on whose unix systems is not the mysqlserver will experience this issue. take an example  of those who use xampp etc on linux among other technologies as those that i personally prefer due to the flexibility they offer me and wonderful tools therein included.

While looking on to most solutions that did the trick for most of the articles on the web, i didn’t the simplest that i may offer you today. This works when mysql is unable to locate the path to your mysqld.sock file on your file system by looking from a wrong source than yours is in probably, like i said, if you are using xampp for linux.

The trick to get such fixed is a simple as appending a reference to the true path of that file to your mysql command, something like:

…/bin/./mysql –socket /opt/lampp/var/mysql/mysql.sock -u root -p

For cases whereby one has installed mysql-server, it may not have beeb properly started, restarting it could make the trick

sudo /etc/init.d/mysql restart



					
Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s