[SWLUG] PHP and the MySQL socket file

Rhys Hardwick rhys.hardwick at gmail.com
Sun Sep 24 13:21:19 UTC 2006


This may be a silly idea, and you have probably thought about this,
but have you tried changing the my.conf to say

[client]
socket=/var/lib/mysql/mysql.sock

instead of

[client]
socket=/tmp/mysql.sock

Rhys

On 23/09/06, Peter Bradley <P.Bradley at dsl.pipex.com> wrote:
> I've just upgraded MySQL to version 5, using the binary installation
> from the MySQL web site.  Everything works fine except for PHP5.
>
> The problem is that following the reinstallation of MySQL, the
> mysql.sock file is no longer in /var/lib/mysql/mysql.sock.  It's now in
> /tmp/mysql.sock; but the PHP5 mysql and mysqli extensions are still look
> for it in the original location (according to phpinfo()).  I tried
> altering php.ini as follows:
>
> mysql.default_socket = /tmp/mysql.sock
>
> ... but this doesn't seem to have made any difference.
>
> I've also created a /etc/my.cnf file containing the following:
>
> [client]
> socket=/tmp/mysql.sock
>
> This doesn't seem to do any good either.
>
> Does anyone know how to tell php where to look for the mysql.sock file?
>
> Cheers
>
>
> Peter
>
> _______________________________________________
> SWLUG Discussion List - Discuss at swlug.org
> http://swlug.org/mailman/listinfo/discuss
>



More information about the Swlug mailing list