469,612 Members | 2,652 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,612 developers. It's quick & easy.

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
Oct 11 '06 #1
6 9535
hg
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 ?
Oct 11 '06 #2
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/...ysql-sock.html for
information on specifying the socket file location.

Regards,
Bill K.
Oct 11 '06 #3
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
Oct 12 '06 #4
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
Oct 13 '06 #5
hg
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
Oct 13 '06 #6
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.
Oct 14 '06 #7

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

4 posts views Thread by faktujaa | last post: by
3 posts views Thread by Daniel | last post: by
3 posts views Thread by Juan | last post: by
5 posts views Thread by John Sheppard | last post: by
2 posts views Thread by manasap | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.