My mysqld broke

Discussion in 'Server Operation' started by domino, Sep 28, 2005.

  1. domino

    domino New Member

    I updated update PHP and I think it updated something mysql. Here is the error message. How can I fix it?
    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!
  2. falko

    falko Super Moderator

    Does /var/run/mysqld/mysqld.sock exist?
    locate mysqld.sock
    to find out where your mysqld.sock is. Maybe its name is mysql.sock instead of mysqld.sock...
  3. domino

    domino New Member

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

  4. domino

    domino New Member

    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:
    So I guess it works now?
  5. falko

    falko Super Moderator

    Seems to be so...
  6. exorcist

    exorcist New Member

    Got the same problem.

    '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....

  7. falko

    falko Super Moderator

    Can you restart MySQL and then run
    locate mysqld.sock
    locate mysql.sock
    What's the output of the two locate commands?
  8. 22hosting

    22hosting New Member

    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: Aug 22, 2011
  9. nyloxy

    nyloxy New Member

    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!! :D

    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. :confused:

    But, happy not to have to run to the tape library and go thru a restore! :( Yuk to that!
    Last edited: Apr 28, 2006
  10. javirebu

    javirebu New Member

    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. :D
  11. Emran

    Emran New Member

    Hi, I am facing error that you have addressed when i run this command.....

    [root@localhost Server]# mysqladmin -u root password mysqldata
    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!
    I have executed your given commands, here is output....
    [root@localhost Server]# updatedb
    [root@localhost Server]# locate mysqld.sock
    [root@localhost Server]# locate mysql.sock
    [root@localhost Server]#
    Kindly advise me... as i am totally stucked!
  12. falko

    falko Super Moderator

    Please restart MySQL.
  13. Emran

    Emran New Member

    Thank you, for your reply.
    Actully mysql server was not installed. only i have installed "mysql client".
    After installing mysql server i was able to interact with it.


Share This Page