MySQL Forums
Forum List  »  Install & Repo

Re: ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2)
Posted by: thanit kebisiri
Date: May 18, 2006 04:06PM

I have a same problem ... and read all post here
I 'm not good skill in mysql but have some luck to fix it
my box is freeBSD 6.0 with mysql-server-4.1.18_2


here is my.cnf
###############
[client]
port = 3306
socket = /tmp/mysql.sock

# The MySQL server
[mysqld]
port = 3306
socket = /tmp/mysql.sock

1.) I disable auto start mysql , by comment '#mysql_enable="YES" ' in /etc/rc.conf and restart freeBSD
2.) I change socket location in my.cnf
socket = /tmp/mysql/mysql.sock in secton [client] and [mysqld] ,
3.) then set -> chown mysql:mysql /tmp/mysql
4.) delete file /tmp/mysq.sock [ if mysq-server still start ... i can not tuch this file ]
5.) start mysql server -> /usr/local/etc/rc.d/mysql-server.sh start
6.) test connect with mysq -u root -p , input passwrod ..... then error ERROR 2002 (HY000) come again...?#!@!!k
7.) ok , I stop mysql server and check at /tmp/mysql , I saw file mysq.sock was created ....wow , but client try to
looking mysql.sock at location /tmp
8.) then I change back socket location in my.cnf -> socket = /tmp/mysql.sock in section [client] and [mysqld]
9.) I start mysql-server again and test connect with mysql ....... and it's ... work :) yes...!
10) I make sure by change back mysql_enable="YES" in /etc/rc.conf and restart freeBSD ,,, test again and it's work.!

hope this idea can help some of you



Edited 1 time(s). Last edit at 05/18/2006 04:08PM by thanit kebisiri.

Options: ReplyQuote


Subject
Written By
Posted
Re: ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2)
May 18, 2006 04:06PM


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.