Go Back   HowtoForge Forums | HowtoForge - Linux Howtos and Tutorials > Linux Forums > Server Operation

Do you like HowtoForge? Please consider supporting us by becoming a subscriber.
Reply
 
Thread Tools Display Modes
  #1  
Old 28th September 2005, 12:11
domino domino is offline
Senior Member
 
Join Date: Aug 2005
Posts: 364
Thanks: 0
Thanked 9 Times in 8 Posts
Unhappy My mysqld broke

I updated update PHP and I think it updated something mysql. Here is the error message. How can I fix it?
Code:
Starting MySQL database server: mysqld...failed.
        Please take a look at the syslog.
/usr/bin/mysqladmin: connect to server at 'localhost' failed
error: 'Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2)'
Check that mysqld is running and that the socket: '/var/run/mysqld/mysqld.sock' exists!
Reply With Quote
Sponsored Links
  #2  
Old 28th September 2005, 12:51
falko falko is offline
Super Moderator
 
Join Date: Apr 2005
Location: Lüneburg, Germany
Posts: 41,701
Thanks: 1,900
Thanked 2,741 Times in 2,575 Posts
Default

Quote:
Originally Posted by domino
I updated update PHP and I think it updated something mysql. Here is the error message. How can I fix it?
Code:
Starting MySQL database server: mysqld...failed.
        Please take a look at the syslog.
/usr/bin/mysqladmin: connect to server at 'localhost' failed
error: 'Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2)'
Check that mysqld is running and that the socket: '/var/run/mysqld/mysqld.sock' exists!
Does /var/run/mysqld/mysqld.sock exist?
Run
Code:
updatedb
locate mysqld.sock
to find out where your mysqld.sock is. Maybe its name is mysql.sock instead of mysqld.sock...
__________________
Falko
--
Download the ISPConfig 3 Manual! | Check out the ISPConfig 3 Billing Module!

FB: http://www.facebook.com/howtoforge

nginx-Webhosting: Timme Hosting | Follow me on:
Reply With Quote
  #3  
Old 28th September 2005, 12:57
domino domino is offline
Senior Member
 
Join Date: Aug 2005
Posts: 364
Thanks: 0
Thanked 9 Times in 8 Posts
Default

locate mysqld.sock resulted in not found. I ran locate mysql.sock and came up with:

/var/lib/mysql/mysql.sock
__________________
Shuttle XPC | Intel 865g | P4 3.2Ghz | ATI 9800 Pro
Hosts: Ubuntu 6.10 ~ XGL-Beryl SVN-Gnome | OS X 10.4.8 | WindowsXP
Virtual Appliances: Ubuntu Server 6.10 | WindowsXP | CentOS 4.4
Reply With Quote
  #4  
Old 28th September 2005, 13:25
domino domino is offline
Senior Member
 
Join Date: Aug 2005
Posts: 364
Thanks: 0
Thanked 9 Times in 8 Posts
Default

Okay, I kinda fixed the proble. I had a copy of the original my.cnf. So i renamed the current one to my.cfg.1 and rename the my.cnf_orig to my.cnf.

Restarted mysqld and it spat out:
Quote:
server1:/etc/mysql# /etc/init.d/mysql start
Starting MySQL database server: mysqld.
Checking for crashed MySQL tables in the background.
So I guess it works now?
Reply With Quote
  #5  
Old 28th September 2005, 13:33
falko falko is offline
Super Moderator
 
Join Date: Apr 2005
Location: Lüneburg, Germany
Posts: 41,701
Thanks: 1,900
Thanked 2,741 Times in 2,575 Posts
Default

Seems to be so...
__________________
Falko
--
Download the ISPConfig 3 Manual! | Check out the ISPConfig 3 Billing Module!

FB: http://www.facebook.com/howtoforge

nginx-Webhosting: Timme Hosting | Follow me on:
Reply With Quote
  #6  
Old 15th April 2006, 19:27
exorcist exorcist is offline
Junior Member
 
Join Date: Apr 2006
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Got the same problem.

Code:
'Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2)
The mysqld.sock doesn't exist.


I have Feather Linux. But i don't have orgininal from my.cnf....

Reply With Quote
  #7  
Old 16th April 2006, 15:16
falko falko is offline
Super Moderator
 
Join Date: Apr 2005
Location: Lüneburg, Germany
Posts: 41,701
Thanks: 1,900
Thanked 2,741 Times in 2,575 Posts
Default

Can you restart MySQL and then run
Code:
updatedb 
locate mysqld.sock
locate mysql.sock
What's the output of the two locate commands?
__________________
Falko
--
Download the ISPConfig 3 Manual! | Check out the ISPConfig 3 Billing Module!

FB: http://www.facebook.com/howtoforge

nginx-Webhosting: Timme Hosting | Follow me on:
Reply With Quote
  #8  
Old 18th April 2006, 10:59
22hosting 22hosting is offline
Junior Member
 
Join Date: Apr 2006
Posts: 26
Thanks: 0
Thanked 1 Time in 1 Post
Default

What you need to do is SIGKILL your mysqld and then remove the my.cnf from /etc/ and then restart mysqld without the my.cnf file and you should be fine.

CMD Expected shortly.


Update :

This line will do the trick for you
kill -9 `ps ax | grep mysqld | tr -s ' ' |cut -d' ' -f1`
*NOTE: you will get a failure as it also thinks the grep is a running process*

then rm /etc/my.cnf

then mysqld restart
________
Asian live

Last edited by 22hosting; 22nd August 2011 at 13:08.
Reply With Quote
  #9  
Old 28th April 2006, 01:45
nyloxy nyloxy is offline
Junior Member
 
Join Date: Apr 2006
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default Thanks everyone!

We had the same problem for my coppermine server. Everything was fine until the box had to be shut down several times because of airconditioning loss in the server room over the last 2 days! During the last reboot had the same:

'Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2)

We tried everything including: permissions on /var/run/mysqld/ , commenting out 'old passwords = 1' in my.cnf, checking for *.sock in another directory, etc...

Then, after looking over all of the different posts I renamed 'my.cnf' to 'my.cnf.old', tried to start mysql daemon again (wouldn't start...couldn't find the my.cnf), then I renamed my.cnf again, restarted - - everything was back up and running!!

Our conclusion is that the my.cnf file may have been corrupt due to the shutting down/starting up that ensued over the last few days (Damn A/C compressor unit kept freezin' up!!), and by re-copying it was corrected. Very strange.

But, happy not to have to run to the tape library and go thru a restore! Yuk to that!

Last edited by nyloxy; 28th April 2006 at 01:52.
Reply With Quote
  #10  
Old 22nd May 2007, 11:57
javirebu javirebu is offline
Junior Member
 
Join Date: May 2007
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
 
Default my solution, from spain

In my case, aborting database back up results in:
"Starting MySQL database server: mysqld...failed.
error: 'Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' '
Check that mysqld is running and that the socket: '/var/run/mysqld/mysqld.sock' exists!"


/var/run/mysqld/ as empty, yes... mysqld failed starting...

I tryed to apply all possible solutions of this post, and nothing...

Finally, with adept, I uninstalled mysql-server5 and install again, and the problem was fixed, and no database lost, all ok.

Thanks for share your experiences and solutions.
Reply With Quote
Reply

Bookmarks

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

Forum Jump


All times are GMT +2. The time now is 08:51.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2014, vBulletin Solutions, Inc.