Composer users can't connect through socket

reficul

Member
Dec 15, 2008
17
0
51
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
 

cPanelMichael

Administrator
Staff member
Apr 11, 2011
47,911
2,234
363
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.