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!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Composer users can't connect through socket

Discussion in 'Database Discussions' 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:
    42,782
    Likes Received:
    1,712
    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.
     
  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:
    42,782
    Likes Received:
    1,712
    Trophy Points:
    363
    cPanel Access Level:
    Root Administrator
Loading...

Share This Page