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

Discussion in 'Workarounds and Optimization' started by ASTRAPI, May 7, 2011.

  1. ASTRAPI

    ASTRAPI Well-Known Member

    Joined:
    Jul 8, 2008
    Messages:
    321
    Likes Received:
    0
    Trophy Points:
    16
    Hello

    All was working great and without editing anything i got today on my forums sql logs this:

    Code:
    Error: Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2)
    Any ideas on how can i fix it on my cpanel server?

    Is it possible to get this from an overload on sql?

    my.cnf doesn't have any setting there related to socket path and it works for many months without any problems.

    Thank you
     
    #1 ASTRAPI, May 7, 2011
    Last edited: May 7, 2011
  2. nobodyk

    nobodyk Well-Known Member

    Joined:
    Aug 1, 2010
    Messages:
    90
    Likes Received:
    0
    Trophy Points:
    6
    Check your permissions. Run this:
    cd /var/lib/mysql
    chmod 777 mysqld.sock

    You can also use the mysqld.sock in /tmp if the above doesn't work.
     
  3. LinuxTechie

    LinuxTechie Well-Known Member

    Joined:
    Jan 22, 2011
    Messages:
    502
    Likes Received:
    2
    Trophy Points:
    18
    cPanel Access Level:
    Root Administrator
    Hello,

    Can you try restarting mysql using the WHM, if you aren't familiar with SSH.
     
Loading...

Share This Page