[CentOS] Centos 6.6 Can't connect to local MySQL server through socket /var/lib/MySQL/MySQL.sock (error 2002)‏

Fri May 22 11:08:33 UTC 2015
Richard <lists-centos at listmail.innovate.net>


------------ Original Message ------------
> Date: Friday, May 22, 2015 12:24:38 PM +0200
> From: Leon Fauster <leonfauster at googlemail.com>
>
> Am 21.05.2015 um 22:43 schrieb Graham Wilman
> <gwillman at hotmail.co.uk>:
>> Total newby to centos I am currently assisting a community radio
>> station set up in the Uk we are using a server based system for
>> our playout software, unfortunately at the moment one of our
>> client servers is experience the above error I came across the
>> error on our main server a few weeks ago and found the solution
>> just by reinstalling the MySQL db but I have tried to deploy the
>> same fix on our client server otherwise known as studio-b client
>> but unfortunately this has not solved the problem any assistance
>> with this would be very much appreciated.
> 
># grep sock /etc/my.cnf 
> socket=/var/lib/mysql/mysql.sock
> 
> 
> --
> LF

Check that mysqld is running. Assuming it is, confirm the location
(including directory/file capitalization) of the socket file -- the
default is as indicated above. If that's all there, then the issue
is that your client is trying to find the socket file in a
non-standard location of /var/lib/MySQL/MySQL.sock. I suspect that
there is a client configuration file that controls this which can be
adjusted.

[you can change where mysqld writes its socket file, but that could
break other applications that use the default location, so I don't
recommend that approach.]