The Community Forums

Interact with an entire community of cPanel & WHM users!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

mysql bug or not?

Discussion in 'General Discussion' started by Secret Agent, Apr 18, 2005.

  1. Secret Agent

    Secret Agent Guest

    I get this intermittently every other day or so even after I correct mysql (confirmed for sure)

    /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").



    MYSQL FIX
    Look in your /etc/my.cnf file and if there is a line like:
    socket=/var/tmp/mysql.sock
    remove it and restart MySQL

    or

    Command lines are as follows.

    root [/]# cd /var/lib/mysql
    root [/var/lib/mysql]# chmod 771 *

    Now all folders and files in the /var/lib/mysql folder are chmod 700
    We need to chmod mysql.sock as 777 so

    root [/var/lib/mysql]# chmod 777 mysql.sock

    you need to chmod your <hostname>.pid file as 660
    to get your hostname:
    root [/var/lib/mysql]# hostname

    then :
    root [/var/lib/mysql]# chmod 660 <hostname>.pid



    This always fixes any mysql issues I've had, but this time around it keeps coming back odd enough. Is anyone having the same problem?

    I'm using MySQL 4.1.8standard
    Cpanel 10.x C34
     
  2. easyhoster1

    easyhoster1 Well-Known Member

    Joined:
    Sep 25, 2003
    Messages:
    659
    Likes Received:
    0
    Trophy Points:
    16
    I have two servers that have it...a second restart attempt always pulls it back up though.
     
  3. Secret Agent

    Secret Agent Guest

    Anyone know of a fix at least?
     
  4. webignition

    webignition Well-Known Member

    Joined:
    Jan 22, 2005
    Messages:
    1,880
    Likes Received:
    0
    Trophy Points:
    36
    When this occurs, have you checked that /var/tmp/mysql.sock exists?

    Perhaps /var/tmp, being something of a temporary directory, is being cleared out by some automated script from time to time.
     
  5. Secret Agent

    Secret Agent Guest

    I always get the error below

    /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").


    It happens out of nowhere and I have to go through the whole process of chmodding everyhing back to normal, restarting mysql again.

    I do not know what is causing it
     
Loading...

Share This Page