Re: PHP 5 MySql 4.1 issue - can't connect to mysql.sock
| From: | user at domain dot invalid | Date: | Sun, 19 Dec 2004 16:16:36 +0000 |
| Subject: | Re: PHP 5 MySql 4.1 issue - can't connect to mysql.sock | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-204677@lists.php.net to get a copy of this message | ||
Barley wrote:
If I run the script from a shell prompt as root, it outputs "Yes". If I run as any other user, it outputs "No." It also gives this error: Warning: mysqli_connect(): Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (13)Check permissions on /var/lib/mysql. From the sockets manpage: NOTES In the Linux implementation, sockets which are visible in the filesystem honour the permissions of the directory they are in. Their owner, group and their permissions can be changed. Creation of a new socket will fail if the process does not have write and search (execute) permission on the directory the socket is created in. Connecting to the socket object requires read/write permission. This behavior differs from many BSD-derived systems which ignore permissions for Unix sockets. Portable programs should not rely on this feature for security.