how do I get the socket and then avoid the 'Can't connect to localMySQL server through socket '...

Hi,


Trying to connect to the MySQL server I get the classic error message

ERROR 2002 (HY000): Can't connect to local MySQL server through socket
'/var/lib/mysql/mysql.sock' (2)

I have tested and know that demon is running and then checket and found
the /var/lib/mysql/mysql.sock file missing.

But how do I get a new socket?


Thanks,

Chris
Christian [ Mi, 11 Oktober 2006 18:40 ] [ ID #1496430 ]

Re: how do I get the socket and then avoid the 'Can't connect tolocal MySQL server through socket '.

Christian wrote:
> Hi,
>
>
> Trying to connect to the MySQL server I get the classic error message
>
> ERROR 2002 (HY000): Can't connect to local MySQL server through socket
> '/var/lib/mysql/mysql.sock' (2)
>
> I have tested and know that demon is running and then checket and found
> the /var/lib/mysql/mysql.sock file missing.
>
> But how do I get a new socket?
>
>
> Thanks,
>
> Chris
Is the server running ?
HG [ Mi, 11 Oktober 2006 20:07 ] [ ID #1496435 ]

Re: how do I get the socket and then avoid the 'Can't connect tolocal MySQL server through socket '

Christian wrote:
> I have tested and know that demon is running and then checket and found
> the /var/lib/mysql/mysql.sock file missing.
>
> But how do I get a new socket?

The socket file is created when the MySQL Server starts. But the MySQL
Server may have a different idea of where that socket file is supposed
to be created. Check your MySQL config file (my.ini or my.cnf) for the
"socket" option.

See also
http://dev.mysql.com/doc/refman/5.0/en/problems-with-mysql-s ock.html for
information on specifying the socket file location.

Regards,
Bill K.
Bill Karwin [ Mi, 11 Oktober 2006 20:15 ] [ ID #1496437 ]

Re: how do I get the socket and then avoid the 'Can't connect tolocal MySQL server through socket '.

hg wrote:
> Christian wrote:
>> Hi,
>>
>>
>> Trying to connect to the MySQL server I get the classic error message
>>
>> ERROR 2002 (HY000): Can't connect to local MySQL server through socket
>> '/var/lib/mysql/mysql.sock' (2)
>>
>> I have tested and know that demon is running and then checket and found
>> the /var/lib/mysql/mysql.sock file missing.
>>
>> But how do I get a new socket?
>>
>>
>> Thanks,
>>
>> Chris
> Is the server running ?

Yes, because

workstation:/home/cmj # ps xa | grep mysqld
17811 pts/4 S+ 0:00 grep mysqld
Christian [ Do, 12 Oktober 2006 09:55 ] [ ID #1497826 ]

Re: how do I get the socket and then avoid the 'Can't connect to local MySQL server through socket '

hi christian,

the output of your ps -

> workstation:/home/cmj # ps xa | grep mysqld
> 17811 pts/4 S+ 0:00 grep mysqld

simply means the grep happened to find itself in the ps output.

try running this instead:

ps xa | grep mysqld | grep -v grep

the -v option says to ignore the string that follows. if nothing comes
back you don't have any mysqld running and you'll have to restart it.

hope this helps,
brian

Christian wrote:
> hg wrote:
> > Christian wrote:
> >> Hi,
> >>
> >>
> >> Trying to connect to the MySQL server I get the classic error message
> >>
> >> ERROR 2002 (HY000): Can't connect to local MySQL server through socket
> >> '/var/lib/mysql/mysql.sock' (2)
> >>
> >> I have tested and know that demon is running and then checket and found
> >> the /var/lib/mysql/mysql.sock file missing.
> >>
> >> But how do I get a new socket?
> >>
> >>
> >> Thanks,
> >>
> >> Chris
> > Is the server running ?
>
> Yes, because
>
> workstation:/home/cmj # ps xa | grep mysqld
> 17811 pts/4 S+ 0:00 grep mysqld
Brian Mac [ Fr, 13 Oktober 2006 15:19 ] [ ID #1499101 ]

Re: how do I get the socket and then avoid the 'Can't connect tolocal MySQL server through socket '.

Christian wrote:
> hg wrote:
>> Christian wrote:
>>> Hi,
>>>
>>>
>>> Trying to connect to the MySQL server I get the classic error message
>>>
>>> ERROR 2002 (HY000): Can't connect to local MySQL server through socket
>>> '/var/lib/mysql/mysql.sock' (2)
>>>
>>> I have tested and know that demon is running and then checket and found
>>> the /var/lib/mysql/mysql.sock file missing.
>>>
>>> But how do I get a new socket?
>>>
>>>
>>> Thanks,
>>>
>>> Chris
>> Is the server running ?
>
> Yes, because
>
> workstation:/home/cmj # ps xa | grep mysqld
> 17811 pts/4 S+ 0:00 grep mysqld
Brian is quite correct (I had not looked at your output carefully) - it
looks like your server is not running.

hg
HG [ Fr, 13 Oktober 2006 16:01 ] [ ID #1499102 ]

Re: how do I get the socket and then avoid the 'Can't connect tolocal MySQL server through socket '.

Brian Mac wrote:
> hi christian,
>
> the output of your ps -
>
>> workstation:/home/cmj # ps xa | grep mysqld
>> 17811 pts/4 S+ 0:00 grep mysqld
>
> simply means the grep happened to find itself in the ps output.
>
> try running this instead:
>
> ps xa | grep mysqld | grep -v grep
>
> the -v option says to ignore the string that follows. if nothing comes
> back you don't have any mysqld running and you'll have to restart it.
>
> hope this helps,
> brian
Thanks brian, you were quite right, and now its working.
Christian [ Sa, 14 Oktober 2006 04:59 ] [ ID #1500119 ]
Datenbanken » mailing.database.mysql » how do I get the socket and then avoid the 'Can't connect to localMySQL server through socket '...

Vorheriges Thema: Change mysql client default socket?
Nächstes Thema: query optimization help please