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.

Database problem

Discussion in 'General Discussion' started by Martini-man, Sep 22, 2004.

  1. Martini-man

    Martini-man Member

    Joined:
    Dec 23, 2003
    Messages:
    7
    Likes Received:
    0
    Trophy Points:
    1
    Hi!

    I have a problem that seems to happen more often from time to time.

    When connecting, the database returned:
    Error 2002: Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (11)

    If I refresh it gives the page fine.

    Is there a way to fix this?

    What is the problem?

    Thanks.
     
  2. axishift

    axishift Member

    Joined:
    Feb 25, 2004
    Messages:
    22
    Likes Received:
    0
    Trophy Points:
    1
    what exactly do you mean when you say..

    "If I refresh it gives the page fine."

    it works correctly? and no error's appear after you refresh?

    ..

    if this error occurs: "Error 2002: Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (11) "

    it means that your mysql did run on a different socket, and its not in the location.

    /var/lib/mysql/mysql.sock

    try to see your my.cnf for its exact location.

    i am assuming you have shell access to check it.

    HTH :rolleyes:
     
  3. Martini-man

    Martini-man Member

    Joined:
    Dec 23, 2003
    Messages:
    7
    Likes Received:
    0
    Trophy Points:
    1
    my.cnf states:

    [mysqld]
    port=3306
    socket=/var/lib/mysql/mysql.sock
    set-variable = max_connections=500
    safe-show-database

    [client]
    port=3306
    socket=/var/lib/mysql/mysql.sock


    And i have 2 mysql.sock:

    root@servidor [/etc]# locate mysql.sock
    /var/lib/mysql/mysql.sock
    /usr/local/lib/mysql.sock


    When i restart mysql i get:

    Attempting to restart mysql
    Waiting for mysql to restart.... . . . . . . . . . . finished.

    mysql status root 14683 2.0 0.1 2180 1040 ? S 12:42 0:00 /bin/sh /usr/bin/mysqld_safe --datadir=/var/lib/mysql --pid-file=/var/lib/mysql/servidor.btuga.com.pid
    mysql 14709 10.0 1.0 30752 10764 ? S 12:42 0:00 /usr/sbin/mysqld --basedir=/ --datadir=/var/lib/mysql --user=mysql --pid-file=/var/lib/mysql/servidor.btuga.com.pid --skip-locking --port=3306 --socket=/var/lib/mysql/mysql.sock
    mysql 14711 0.0 1.0 31104 10792 ? R 12:42 0:00 /usr/sbin/mysqld --basedir=/ --datadir=/var/lib/mysql --user=mysql --pid-file=/var/lib/mysql/servidor.btuga.com.pid --skip-locking --port=3306 --socket=/var/lib/mysql/mysql.sock
    mysql 14712 0.0 1.0 31104 10800 ? S 12:42 0:00 /usr/sbin/mysqld --basedir=/ --datadir=/var/lib/mysql --user=mysql --pid-file=/var/lib/mysql/servidor.btuga.com.pid --skip-locking --port=3306 --socket=/var/lib/mysql/mysql.sock
    mysql 14713 0.0 1.0 31104 10800 ? S 12:42 0:00 /usr/sbin/mysqld --basedir=/ --datadir=/var/lib/mysql --user=mysql --pid-file=/var/lib/mysql/servidor.btuga.com.pid --skip-locking --port=3306 --socket=/var/lib/mysql/mysql.sock
    mysql 14714 1.0 1.0 31104 10800 ? S 12:42 0:00 /usr/sbin/mysqld --basedir=/ --datadir=/var/lib/mysql --user=mysql --pid-file=/var/lib/mysql/servidor.btuga.com.pid --skip-locking --port=3306 --socket=/var/lib/mysql/mysql.sock
    mysql 14715 0.0 1.0 31104 10800 ? S 12:42 0:00 /usr/sbin/mysqld --basedir=/ --datadir=/var/lib/mysql --user=mysql --pid-file=/var/lib/mysql/servidor.btuga.com.pid --skip-locking --port=3306 --socket=/var/lib/mysql/mysql.sock
    mysql 14720 0.0 1.0 31104 10800 ? S 12:42 0:00 /usr/sbin/mysqld --basedir=/ --datadir=/var/lib/mysql --user=mysql --pid-file=/var/lib/mysql/servidor.btuga.com.pid --skip-locking --port=3306 --socket=/var/lib/mysql/mysql.sock
    mysql 14721 0.0 1.0 31104 10800 ? S 12:42 0:00 /usr/sbin/mysqld --basedir=/ --datadir=/var/lib/mysql --user=mysql --pid-file=/var/lib/mysql/servidor.btuga.com.pid --skip-locking --port=3306 --socket=/var/lib/mysql/mysql.sock
    mysql 14722 0.0 1.0 31104 10800 ? S 12:42 0:00 /usr/sbin/mysqld --basedir=/ --datadir=/var/lib/mysql --user=mysql --pid-file=/var/lib/mysql/servidor.btuga.com.pid --skip-locking --port=3306 --socket=/var/lib/mysql/mysql.sock
    mysql 14723 0.0 1.0 31104 10800 ? S 12:42 0:00 /usr/sbin/mysqld --basedir=/ --datadir=/var/lib/mysql --user=mysql --pid-file=/var/lib/mysql/servidor.btuga.com.pid --skip-locking --port=3306 --socket=/var/lib/mysql/mysql.sock
    mysql 14724 0.0 1.0 31104 10800 ? S 12:42 0:00 /usr/sbin/mysqld --basedir=/ --datadir=/var/lib/mysql --user=mysql --pid-file=/var/lib/mysql/servidor.btuga.com.pid --skip-locking --port=3306 --socket=/var/lib/mysql/mysql.sock
    mysql 14725 0.0 1.0 31104 10800 ? S 12:42 0:00 /usr/sbin/mysqld --basedir=/ --datadir=/var/lib/mysql --user=mysql --pid-file=/var/lib/mysql/servidor.btuga.com.pid --skip-locking --port=3306 --socket=/var/lib/mysql/mysql.sock
    mysql 14726 0.0 1.0 31104 10800 ? S 12:42 0:00 /usr/sbin/mysqld --basedir=/ --datadir=/var/lib/mysql --user=mysql --pid-file=/var/lib/mysql/servidor.btuga.com.pid --skip-locking --port=3306 --socket=/var/lib/mysql/mysql.sock



    mysql started ok


    I guess it usees the sock /var/lib/mysql/mysql.sock and if so my.cnf must be well configurated, right?

    Can you or anyone help me with this?

    Thanks
     
Loading...

Share This Page