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.

Can't connect to local MySQL server through socket '/tmp/mysql.sock'

Discussion in 'General Discussion' started by gopederick, Jul 2, 2004.

  1. gopederick

    gopederick Active Member

    Joined:
    Nov 11, 2003
    Messages:
    26
    Likes Received:
    0
    Trophy Points:
    1
    Hello, my mysql suddonly stopped working. It was compltely random.

    mySQL error: Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2)
    mySQL error code:

    I get that error.

    I tried to copy it into tmp folder from /var/db/mysql/ but it says it exists... but it does not.

    cp1# cp -rf /var/db/mysql/mysql.sock ../../tmp/
    cp: symlink: /tmp/mysql.sock: File exists

    Please help.

    thx.

    If all else fail what would be the best way to copy the databases reinstall mysql and put the databases back?
     
  2. linux-image

    linux-image Well-Known Member

    Joined:
    Jun 8, 2004
    Messages:
    1,192
    Likes Received:
    1
    Trophy Points:
    38
    Location:
    India
    cPanel Access Level:
    Root Administrator
    cd /tmp

    rm -rf mysql.sock

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

    that will do.
     
  3. gopederick

    gopederick Active Member

    Joined:
    Nov 11, 2003
    Messages:
    26
    Likes Received:
    0
    Trophy Points:
    1
    That doesn't work :\

    cp1# mysql
    ERROR 2002: Can't connect to local MySQL server through socket '/tmp/mysql.sock' (62)

    Btw I am on freebsd 4.8 with mysql (4.0.10-gamma)

    Maybe I can just uninstall mysql and make cpanel reinstall it with a cpanel update? How would i uninstall cpanel without deleting/remove the current databases.

    thx.
     
    #3 gopederick, Jul 2, 2004
    Last edited: Jul 2, 2004
  4. linux-image

    linux-image Well-Known Member

    Joined:
    Jun 8, 2004
    Messages:
    1,192
    Likes Received:
    1
    Trophy Points:
    38
    Location:
    India
    cPanel Access Level:
    Root Administrator
    freebsd :eek: am not sure the..

    also you can try a restart for the mysql that will create the socket the natural way.
     
  5. eger

    eger Well-Known Member

    Joined:
    Feb 28, 2003
    Messages:
    128
    Likes Received:
    0
    Trophy Points:
    16
    i am having this problem also on my freebsd 4.10 box. was there ever a solution for this?
     
  6. AlexF

    AlexF Well-Known Member

    Joined:
    Nov 20, 2003
    Messages:
    148
    Likes Received:
    0
    Trophy Points:
    16
    Try this:

    /usr/local/bin/mysqld &
     
Loading...

Share This Page