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 05-02-2008, 05:26 AM
Registered User
 
Join Date: Apr 2008
Posts: 4
neomas is on a distinguished road
Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (111)

I don't know how to solve error

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

when i restart SQL Server (MySQL) on WHM
it's error

/usr/bin/mysqladmin: connect to server at 'localhost' failed
error: 'Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (111)'
Check that mysqld is running and that the socket: '/var/lib/mysql/mysql.sock' exists!
mysql has failed, please contact the sysadmin (result was "mysql has failed").
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 05-02-2008, 08:20 AM
Stephanie_R's Avatar
Registered User
 
Join Date: Mar 2004
Posts: 36
Stephanie_R is on a distinguished road
Sounds like something ate your symlink in /tmp

ln -s /var/lib/mysql/mysql.sock /tmp/mysql.sock

restart MySQL
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3 (permalink)  
Old 05-03-2008, 12:27 AM
Registered User
 
Join Date: Apr 2008
Posts: 4
neomas is on a distinguished road
Angry

I try to solved and fixed everything but still same.
I don't know how to solve about this problem.

pls. help me.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #4 (permalink)  
Old 05-03-2008, 01:48 AM
rpmws's Avatar
Registered User
 
Join Date: Aug 2001
Location: back woods of NC, USA
Posts: 1,834
rpmws is on a distinguished road
Quote:
Originally Posted by neomas View Post
I try to solved and fixed everything but still same.
I don't know how to solve about this problem.

pls. help me.
/scripts/restartsrv_mysql

if that doesn't work.

/scripts/mysqlup --force
__________________
Just keeping my "eye" on things....
R. Paul Mathews
RPMWS - diehard cPanel Nutcase
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #5 (permalink)  
Old 05-03-2008, 02:54 PM
cpanelkenneth's Avatar
cPanel Quality Assurance
 
Join Date: Apr 2006
Posts: 3,222
cpanelkenneth is on a distinguished road
Also try

/scripts/mysqlconnectioncheck
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #6 (permalink)  
Old 05-07-2008, 11:54 PM
Registered User
 
Join Date: Apr 2007
Location: Bandung
Posts: 1
romyloice is on a distinguished road
Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock

Same with me..

Mine :
WHM 11.15.0 cPanel 11.18.5-R24173
CENTOS Enterprise 5 x86_64 on standard - WHM X v3.1.0

/scripts/mysqlup --force
completed, but still have the same problem..
error message :
/usr/bin/mysqladmin: connect to server at 'localhost' failed error: 'Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2)' Check that mysqld is running and that the socket: '/var/lib/mysql/mysql.sock' exists! mysql has failed, please contact the sysadmin (result was "Warning, no valid mysql.sock file found.mysql has failed").

checking /var/lib/mysql/mysql.sock does not exist..

/scripts/mysqlconnectioncheck gives nothing..

Any clue ??

Last edited by romyloice; 05-08-2008 at 12:07 AM.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #7 (permalink)  
Old 05-09-2008, 01:47 AM
shital's Avatar
Registered User
 
Join Date: May 2007
Posts: 11
shital is on a distinguished road
Hello,

Did you check the partition size on file system?? I mean may be /var is 100% full on server. Thats the reason mysql could not be started on server.

MySQL sock file not found
====================

= killall -9 mysqld
= service mysql stop
=cp var/lib/mysql/mysql.sock var/lib/mysql/mysql.sock_backup
= rm -f /var/lib/mysql/mysql.sock
= service mysql start
= ln -s /tmp/mysql.sock /var/lib/mysql/mysql.sock
= /scripts/restartsrv mysql

Hope this will help you to resolve this issue as it helps me always

Shital
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #8 (permalink)  
Old 05-20-2008, 10:37 AM
Registered User
 
Join Date: Dec 2003
Posts: 6
Bigwebmaster
Try and open up your /etc/my.cnf file and see if you can find this:

Code:
[mysql.server]
user=mysql
basedir=/var/lib
Comment out the basedir variable so that it looks like this:

Code:
[mysql.server]
user=mysql
#basedir=/var/lib
Then try and restart mysql and see if that fixes it.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #9 (permalink)  
Old 06-18-2008, 09:31 AM
Registered User
 
Join Date: Jun 2004
Posts: 29
FourMat
Quote:
Originally Posted by Bigwebmaster View Post

Comment out the basedir variable so that it looks like this:

Code:
[mysql.server]
user=mysql
#basedir=/var/lib
Then try and restart mysql and see if that fixes it.
Can someone tell me why this works?

I just made that change and now my mysql server is up and running after having the same problem as the original poster.....
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #10 (permalink)  
Old 06-18-2008, 12:13 PM
cpanelkenneth's Avatar
cPanel Quality Assurance
 
Join Date: Apr 2006
Posts: 3,222
cpanelkenneth is on a distinguished road
Quote:
Originally Posted by FourMat View Post
Can someone tell me why this works?

I just made that change and now my mysql server is up and running after having the same problem as the original poster.....
The basedir directive instructs MySQL where to find everything it needs to function: binaries, libraries, data, etc. Hence by stipulating basedir=/var/lib, MySQL will search /var/lib for everything needed to perform its functions.

For typical installs via RPM, this directive is not needed and should not be used. For a more exhaustive description of this directive, please consult the MySQL manual.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #11 (permalink)  
Old 06-18-2008, 12:57 PM
Registered User
 
Join Date: Jun 2004
Posts: 29
FourMat
Thanks for the info. I am trying to get this newly configured server up and running and was a little surprised to find that the mysql server wasn't working out of the box.

Thanks for the help!
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #12 (permalink)  
Old 06-19-2008, 09:56 AM
cpanelkenneth's Avatar
cPanel Quality Assurance
 
Join Date: Apr 2006
Posts: 3,222
cpanelkenneth is on a distinguished road
Quote:
Originally Posted by FourMat View Post
Thanks for the info. I am trying to get this newly configured server up and running and was a little surprised to find that the mysql server wasn't working out of the box.

Thanks for the help!
Nothing in cPanel adds the basedir directive to /etc/my.cnf, which means it was added by something/someone outside cPanel's functions.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #13 (permalink)  
Old 06-21-2008, 01:30 PM
Registered User
 
Join Date: Jul 2007
Location: Chile - SCL
Posts: 18
bhstudios is on a distinguished road
Smile

Quote:
Originally Posted by FourMat View Post
Can someone tell me why this works?

I just made that change and now my mysql server is up and running after having the same problem as the original poster.....
Excellent contribution, i was totally lost tried evrything, only think that worked was this, thanks FourMat
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 03:15 PM.


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