0
votes

Tried all posts for solution . ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2)

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

Can't connect to local MySQL server through socket '/var/mysql/mysql.sock' (38)

During Follow ups got another issue.. sudo: effective uid is not 0, is sudo installed setuid root?

So for this Tried following post

http://ubuntuforums.org/showthread.php?t=2222715

sudo: effective uid is not 0, is sudo installed setuid root?

Also got this chown: changing ownership of `/usr/bin/sudo': Operation not permitted

anybody give perfect solution for this.. Except re-installing OS.. I don't have rescue disk for recovery.

1
How you're connecting to mysql , using command line ? if yes please provide the command which you're using. Also tell us what OS is that.Juned
yes i'm connected using command line on linux.. I'm using this command mysql -uroot -pVarun Chawla
okay and what is mysql service status /etc/init.d/mysql status ?Juned
Did you try with restarting mysql services ? Also what is the output of netstat -pan | grep 3306 command ? What OS is that BTW ?Juned
Its Ubuntu O/p (No info could be read for "-p": geteuid()=1000 but you should be root.)Varun Chawla

1 Answers

0
votes

Try to stop your mysql server and restart it again.

/etc/init.d/mysql  stop
/etc/init.d/mysql  start

Still same issue then rename mysql.sock file from mysql directory e.g. /var/lib/mysql/mysql.sock folder and restart mysql server.