MySQL Forums
Forum List  »  Install & Repo

Re: ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2)
Posted by: Jakub TCP
Date: December 15, 2005 09:07AM

Here we go............ There are two things that could go wrong here:

1. You don't have permissions to access the directory /var/lib/mysql/whatever.sock because mysql is the owner of the folder
or
2. /path/whatever.sock doesn't exist.

You can try this though [Linux specific, but what other operating systems are there?]
Go to /etc/my.cnf and change/add the lines:

[mysqld]
datadir=/var/lib/mysql
socket=/tmp/mysql.sock
[client]
socket=/tmp/mysql.sock

This way the client and server use the same socket and it's in a public directory. This solves my MySql problems 98% of the time.


Jakub TCP

Linux localhost.localdomain 2.6.9-11.ELsmp

Options: ReplyQuote


Subject
Written By
Posted
January 08, 2009 02:01PM
Re: ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2)
December 15, 2005 09:07AM
April 15, 2009 11:56AM
October 21, 2009 06:18PM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.