Go Back   cPanel Forums > cPanel® and WHM® (for Linux® and FreeBSD® Servers) > cPanel and WHM Discussions

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 06-27-2004, 03:53 AM
Registered User
 
Join Date: Jan 2004
Location: North Carolina
Posts: 7
Outofmymindyo
Fix: Can't connect to local MySQL server through socket'/var/lib/mysql/mysql.sock'(2)

Just wanted to post this possible fix for people that are getting the following error when trying to start/restart MySQL, as this procedure worked perfectly for me.

Code:
Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2)
This is the procedure I followed:

Code:
Techy: Login as root to WHM and look at the service status
Techy: See what all is red
Me: just eximstats and MySQL right now
Techy: Look in /var/lib/mysql
Me: there's more than one .err file
Techy: ls -l|grep err


Me: -rw-rw----    1 nobody   root         1227 May  5 09:21 C0001-planetXeonimaging.err 
 -rw-rw----    1 nobody   root         1227 Jun 20 13:53 C0001-planetXeonRH9CP.err 
 -rw-rw----    1 nobody   root         3915 Jun 26 02:24 domain.err 
 -rw-rw----    1 mysql    root        13080 Jun 26 07:56 hostname.domain.com.err 
 -rw-rw----    1 nobody   root         4068 Apr 29 18:29 localhost.localdomain.err


Techy: Look in hostname.domain.err
Techy: Show me the last lines of that file


Me: 040626 08:05:27  mysqld started 
 040626  8:05:27  Can't start server : Bind on unix socket: Permission denied 
 040626  8:05:27  Do you already have another mysqld server running on socket: /var/lib/mysql/mysql.sock ? 
 040626  8:05:27  Aborting 
  
 040626  8:05:27  /usr/sbin/mysqld: Shutdown Complete 
  
 040626 08:05:27  mysqld ended


Techy: ps aux|grep mysql


Me: root     14658  0.0  0.0  3580  632 pts/2    S    08:06   0:00 grep mysql


Techy: rm /var/lib/mysql/mysql.sock
Techy: service mysql start


Me: rm: cannot lstat `/var/lib/mysql/mysql.sock': No such file or directory


Techy: cd /var/lib
Techy: ls -l|grep mysql


Me: drwxr-x--x   88 nobody   root         4096 Jun 26 08:05 mysql/


Me: is that supposed to be that way?
Techy: Checking
Me: k
Techy: chown mysql:root mysql mysql
Techy: errr
Techy: chown mysql:root mysql
Techy: service mysql start
Me: shall i run that chown command in the top directory?
Me: or just the var/lib?
Techy: In /var/lib
Me: ok, ran service mysql start
Me: no confirmation or errors
Techy: ps aux|grep mysql
Me: WHM doesn't show it as running


Me: root     14696  0.0  0.1  4196 1180 pts/2    S    08:11   0:00 /bin/sh /usr/bin/mysqld_safe --datadir=/var/lib/mysql --pid-file=/var/lib/mysql/hostname.domain.com.pid 
 mysql    14716  0.2  1.1 31208 11604 pts/2   S    08:11   0:00 /usr/sbin/mysqld --basedir=/ --datadir=/var/lib/mysql --user=mysql --pid-file=/var/lib/mysql/g 
 eekland.domain.com.pid --skip-locking 
 root     14744  0.0  0.0  3576  632 pts/2    S    08:12   0:00 grep mysql


Techy: chskervd will pick it up in a few minutes

Last edited by Outofmymindyo; 06-27-2004 at 03:56 AM.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT -5. The time now is 11:13 AM.


Powered by vBulletin® Version 3.8.2
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
© cPanel Inc