Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 11 Jul 2008 09:54:12 -0400
From:      Steve Bertrand <steve@ibctech.ca>
To:        =?ISO-8859-1?Q?=D2=E0=F0=E0=F1?= <Golub_Taras@i.ua>
Cc:        freebsd-questions@freebsd.org
Subject:   Re: Can't connect to local MySQL server through socket '/tmp/mysql.sock
Message-ID:  <48776604.4070403@ibctech.ca>
In-Reply-To: <E1KHIx7-0003YC-MD@web06.mi6.kiev.ua>
References:  <E1KHIx7-0003YC-MD@web06.mi6.kiev.ua>

next in thread | previous in thread | raw e-mail | index | archive | help
Тарас wrote:
> Hi! I need two MySQL servers run simultaneously. But when I try to run server I have
> 
>  ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2)

Does this happen when you try to start the first instance, or starting 
the second instance when you already have one started.

If the latter is the case, you are going to have to tell the second 
instance to use a different socket file.

# touch /tmp/mysql.sock2
# chmod mysql_user:mysql_group /tmp/mysql.sock2

....and then, I believe if you add this to your /etc/my.cnf file:

[mysqld]
socket=/tmp/mysql.sock2

This should start at least one of your instances on the new socket, 
leaving the other one alone.

Note: I have not tested the above, its off the top of my head. Be worth 
Googling for verification.

Steve



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?48776604.4070403>