Re: mysql_connect using version 5.0.1 accesses the internet when host and client are the same system
| From: | Andrey Hristov | Date: | Thu, 16 Sep 2004 07:44:10 +0000 |
| Subject: | Re: mysql_connect using version 5.0.1 accesses the internet when host and client are the same system | ||
| References: | 1 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-12853@lists.php.net to get a copy of this message | ||
Sam Hobbs wrote:
I am using PHP Version 5.0.1, MySQL 5.0.1-alpha-nt, and Apache/2.0.48 with Windows XP with SP2. When I use mysql_connect in a php page in Apache to connect to the "localhost" I get: Warning: mysql_connect() [function.mysql-connect.chm]: Can't connect to MySQL server on 'localhost' (10061) I get that when the firewall does not allow Apache and MySQL to access the internet. When I do allow Apache to access the internet, mysql_connect with the same parameters works. Is that waht is supposed to happen? I assume this is a PHP problem but I can't be sure it is, so I apologize if it is not. I realize that I have not provided much information. If access to the internet is normal when the server and client are in the same system, then I won't spend much more time on this. If however it sounds like a bug, then I will gather as much information that I can and submit a bug report. Hi,AFAIK MySQL on windows by default tries to use TCP/IP, this differs from the default behavior on *nix, where it tries to Unix socket and after that TCP/IP. On windows nt one can use named pipes, however they are not enabled by default. Use --enable-named-pipe, or just --skip-networking. The latter instructs MySQL not to use TCP/IP. More info here : http://dev.mysql.com/doc/mysql/en/Can_not_connect_to_server.html HTH, Andrey