Re: mysql_connect('localhost') should use tcp/ip instead of socket
| From: | Andrey Hristov | Date: | Sun, 03 Oct 2004 08:10:22 +0000 |
| Subject: | Re: mysql_connect('localhost') should use tcp/ip instead of socket | ||
| References: | 1 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-13112@lists.php.net to get a copy of this message | ||
Roland Tapken wrote:
Hi! When using 'localhost' in mysql_connect(), php tries to use a socket to connect to the mysql daemon. Is there a way to force php to resolve the hostname of localhost, maybe by patching some source file? The reason is that a socket is not avaible because mysql and apache are running in different chroot jails on my server. gruß, RolandHi, I think it is well mentioned in MySQL's docs that localhost has special meaning for MySQL and when it is specified the client tries to connect using unix socket(non-win32). As Sara said, the workaround is 127.0.0.1 Andrey