Please whitelist cPanel in your adblocker so that you’re able to see our version release promotions, thanks!

The Community Forums

Interact with an entire community of cPanel & WHM users!

Composer users can't connect through socket

Discussion in 'Database Discussion' started by reficul, Apr 3, 2018.

Tags:
  1. reficul

    reficul Member

    Joined:
    Dec 15, 2008
    Messages:
    17
    Likes Received:
    0
    Trophy Points:
    51
    Location:
    Italy
    cPanel Access Level:
    Root Administrator
    I start to fight with this issue with "composer update",

    Code:
    In PDOConnection.php line 47:
                                                        
      SQLSTATE[HY000] [2002] No such file or directory 
                                                        
    
    In PDOConnection.php line 43:
                                                        
      SQLSTATE[HY000] [2002] No such file or directory 
    
    then I start to think that the problem is related to cpanel+composer but after some investigation I found that if I log as a user (with root there are no issues) and try "mysql" command I got also an error:

    Code:
    ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2 "No such file or directory")
    
    If I try to locate mysql.sock:

    Code:
    lrwxrwxrwx 1 root root 30  3 apr 13.13 /tmp/mysql.sock -> ../../var/lib/mysql/mysql.sock
    (broken link, not broken with root user)

    also in my /etc/my.cnf I've:
    Code:
    [client]
    socket=/var/lib/mysql/mysql.sock
    
     
  2. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    43,711
    Likes Received:
    1,794
    Trophy Points:
    363
    cPanel Access Level:
    Root Administrator
    Hello,

    Could you let us know the permissions and ownership values on the MySQL socket file? EX:

    Code:
    stat /var/lib/mysql/mysql.sock
    Thank you.
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  3. reficul

    reficul Member

    Joined:
    Dec 15, 2008
    Messages:
    17
    Likes Received:
    0
    Trophy Points:
    51
    Location:
    Italy
    cPanel Access Level:
    Root Administrator
    Code:
    Accesso: (0777/srwxrwxrwx)  Uid: (  994/   mysql)   Gid: (  991/   mysql)
    
     
  4. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    43,711
    Likes Received:
    1,794
    Trophy Points:
    363
    cPanel Access Level:
    Root Administrator
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
Loading...

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice