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 doesn't connect to socket

Discussion in 'Database Discussions' started by uadm, Nov 24, 2013.

  1. uadm

    uadm Well-Known Member

    Joined:
    May 19, 2003
    Messages:
    81
    Likes Received:
    0
    Trophy Points:
    6
    when we configured our sites to connect to 'localhost' we get:
    Warning: mysql_connect(): Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2)

    # perror 2
    OS error code 2: No such file or directory
    root@host [~]# ls -la /var/lib/mysql/mysql.sock
    srwxrwxrwx 1 mysql mysql 0 Nov 24 10:50 /var/lib/mysql/mysql.sock=
    root@host [~]# ls -lad /
    dr-xr-xr-x. 23 root root 4096 Nov 7 02:27 //
    root@host [~]# ls -lad /var
    drwxr-xr-x. 26 root root 4096 Nov 20 02:11 /var/
    root@host [~]# ls -lad /var/lib
    drwxr-xr-x. 25 root root 4096 Nov 5 12:11 /var/lib/
    root@host [~]# ls -lad /var/lib/mysql
    drwxr-x--x 36 mysql mysql 4096 Nov 24 10:50 /var/lib/mysql/

    how do we fix it?

    Thanks.
     
    #1 uadm, Nov 24, 2013
    Last edited: Nov 24, 2013
  2. uadm

    uadm Well-Known Member

    Joined:
    May 19, 2003
    Messages:
    81
    Likes Received:
    0
    Trophy Points:
    6
    [SOLVED]

    This was a problem with cloudlinux's cagefs

    adding /var/lib/mysql to /etc/cagefs/cagefs.mp
    and running cagefsctl --remount-all
    fixed the problem
     
Loading...

Share This Page