ERROR 2002 (HY000): Can’t connect to local MySQL server through socket ‘/tmp/mysql.sock’ (38)

by Herman Tarigan on December 4, 2008

[root@ibm /var/db/mysql]# uname -a
FreeBSD ibm.jc 7.0-RELEASE FreeBSD 7.0-RELEASE #0: Sun Feb 24 19:59:52 UTC 2008     root@logan.cse.buffalo.edu:/usr/obj/usr/src/sys/GENERIC  i386

[root@ibm /var/db/mysql]# mysql
ERROR 2002 (HY000): Can’t connect to local MySQL server through socket ‘/tmp/mysql.sock’ (38)

[root@ibm /var/db/mysql]# ls -al /tmp/mysql.sock
-rw-r–r–  1 root  wheel  0 Dec  4 10:15 /tmp/mysql.sock

Just delete file /tmp/mysql.sock and restart mysql-server

[root@ibm /var/db/mysql]# rm -f /tmp/mysql.sock

[root@ibm /var/db/mysql]# /usr/local/etc/rc.d/mysql-server restart
mysql not running? (check /var/db/mysql/ibm.jc.pid).
Starting mysql.

[root@ibm /var/db/mysql]# ls -al /tmp/mysql.sock
srwxrwxrwx  1 mysql  wheel  0 Dec  4 10:38 /tmp/mysql.sock

[root@ibm /var/db/mysql]# mysql
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 1
Server version: 6.0.7-alpha FreeBSD port: mysql-server-6.0.7

Type ‘help;’ or ‘\h’ for help. Type ‘\c’ to clear the buffer.

mysql>

Herman Tarigan

Pernah menjadi Operator warnet, Customer Service Webhosting, System Administrator Webhosting, Website (SEO) Consultant, Operational Manager, Marketing dan sekarang memilih menjadi FREELANCE :)

Incoming search terms for the article:

Cant connect to local MySQL server through socket /tmp/mysql sock (2), ERROR 2002 (HY000): Cant connect to local MySQL server through socket /tmp/mysql sock (2), error 2002 hy000 cant connect to local mysql server through socket tmp mysql sock 2 freebsd, error 2002 mysql, error 2002 (hy000): cant connect to local mysql server through socket /tmp/mysql sock freebsd
Share and Enjoy:
  • Digg
  • del.icio.us
  • Facebook
  • Google
  • LinkedIn
  • Live
  • Print this article!
  • Slashdot
  • StumbleUpon
  • Technorati
  • YahooMyWeb

{ 1 comment… read it below or add one }

ayik December 5, 2008 at 6:54 pm

ngeteh

Reply

Leave a Comment

*
To prove you're a person (not a spam script), type the security word shown in the picture. Click on the picture to hear an audio file of the word.
Click to hear an audio file of the anti-spam word