MySQL Forums :: General :: ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/tmp/mysql.sock' (61)


Advanced Search

ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/tmp/mysql.sock' (61)
Posted by: Vidal Garza ()
Date: April 02, 2008 04:32PM

Hi...
I need test mysql connections but i have a problem...

freebsd# uname -a
FreeBSD freebsd.aduanet.net 6.3-RELEASE FreeBSD 6.3-RELEASE #0: Wed Jan 16 04:18:52 UTC 2008 root@dessler.cse.buffalo.edu:/usr/obj/usr/src/sys/GENERIC i386
freebsd# mysql --version
mysql Ver 14.12 Distrib 5.0.51a, for portbld-freebsd6.3 (i386) using 5.2
freebsd# more /var/db/mysql/my.cnf
[CLIENT]
port = 3306
socket = /tmp/mysql.sock
[MYSQLD]
port = 3306
ndbcluster
socket = /tmp/mysql.sock
query_cache_type = 1
query_cache_size = 26214400
ndb-connectstring=192.168.6.1
max_user_connections = 500
max_connections = 3000
max_connect_errors = 10
table_cache = 2048
thread_cache_size = 500
[MYSQL_CLUSTER]
ndb-connectstring=192.168.6.1
freebsd#

on the script i have...

cnt=0
while true; do
query="insert into Mytable values('99','`date +%d-%H:%M`','$cnt');"
/usr/local/bin/mysql -u root -ppasswd -e "$query" MYDB >/dev/null
if [ $cnt -eq 999999 ];then
break
else
cnt=`expr $cnt "+" 1`
fi
done


but it return error on the screen like and this its my PROBLEM! I would like that all connections finish ok. The errors not apear on mysql_error file.

: Can't connect to local MySQL server through socket '/tmp/mysql.sock' (61)
ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/tmp/mysql.sock' (61)
ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/tmp/mysql.sock' (61)
ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/tmp/mysql.sock' (61)
ERRORERROR 2002 (HY000) 2002 (HY000): Can't connect to local MySQL server through socket '/tmp/mysql.sock' (61)
: Can't connect to local MySQL server through socket '/tmp/mysql.sock' (61)
ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/tmp/mysql.sock' (61)
ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/tmp/mysql.sock' (61)
ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/tmp/mysql.sock' (61)
ERRORERROR 2002 (HY000) 2002 (HY000): Can't connect to local MySQL server through socket '/tmp/mysql.sock' (61)
: Can't connect to local MySQL server through socket '/tmp/mysql.sock' (61)
ERRORERROR 2002 (HY000) 2002 (HY000): Can't connect to local MySQL server through socket '/tmp/mysql.sock' (61)
: Can't connect to local MySQL server through socket '/tmp/mysql.sock' (61)
ERROR 2002 (HY000)ERROR: Can't connect to local MySQL server through socket '/tmp/mysql.sock' (61)


The file mysql.sock exist...
freebsd# ll /tmp
total 10
drwxrwxrwt 2 root wheel 512 Mar 13 04:00 .ICE-unix
drwxrwxrwt 2 root wheel 512 Mar 13 04:00 .X11-unix
drwxrwxrwt 2 root wheel 512 Mar 13 04:00 .XIM-unix
drwxrwxrwt 2 root wheel 512 Mar 13 04:00 .font-unix
drwxrwxr-x 2 root operator 512 Mar 10 06:44 .snap
srwxrwxrwx 1 mysql wheel 0 Apr 2 16:04 mysql.sock
freebsd#

i change the owner but nothing
freebsd# ll /tmp/mysql.sock
srwxrwxrwx 1 mysql mysql 0 Apr 2 16:04 /tmp/mysql.sock
freebsd#

the Mysql its up
freebsd# ps awx | grep mysqld
25121 p2 S 1:21.87 [mysqld]
freebsd#

When i connect to mysql it show me error
ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/tmp/mysql.sock' (61)

but i try again and i in


mysql> show status like 'Thre%';
+-------------------+-------+
| Variable_name | Value |
+-------------------+-------+
| Threads_cached | 94 |
| Threads_connected | 26 |
| Threads_created | 120 |
| Threads_running | 3 |
+-------------------+-------+
4 rows in set (0.14 sec)

mysql>



Edited 2 time(s). Last edit at 04/02/2008 06:17PM by Vidal Garza.

Options: ReplyQuote


Subject Written By Posted
ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/tmp/mysql.sock' (61) Vidal Garza 04/02/2008 04:32PM
Re: ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/tmp/mysql.sock' (61) bamba lele 08/13/2008 08:36AM


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.