ID: 48082 Updated by: paj...@php.net Reported By: andrew dot answer at gmail dot com -Status: Verified +Status: Assigned Bug Type: MySQL related Operating System: win32 only - Windows XP PHP Version: 5.3.0RC1 -Assigned To: +Assigned To: mysql New Comment:
Andrei, fixable? or need help on this one? I'm not sure it is very critical or widely used. it could wait for 5.3.1. Previous Comments: ------------------------------------------------------------------------ [2009-04-27 16:27:34] andrew dot answer at gmail dot com I think it's because you use new mysql library (mysqlnd) in background of mysql-related functions, and break the default behavior. ------------------------------------------------------------------------ [2009-04-27 16:24:35] andrew dot answer at gmail dot com php is php-5.3.0RC1-Win32-VC6-x86.msi, thread-safe version. I think what behavior of mysql_connect should be same as in previous php version(s). I check different host values for php 5.2.5: null - FAILED '' - FAILED 'localhost' - FAILED '.' - OK Please refer to php and mysql documentation and mysqli_ functions. ------------------------------------------------------------------------ [2009-04-27 00:04:04] matt...@php.net No it's not Jani. :-) Confirmed. Looks like it's with the VC9 binaries -- is that what you are using (not VC6)? Another difference related to getaddrinfo... '' (empty string) and 'localhost' work. BTW localhost is actually using TCP/IP, contrary to what the manual says. Also (even in 5.2), the empty string is also changing to localhost -- I'm not sure when the behavior changed (or if it's MySQL server-related), but that used to use a named pipe without needing to specify '.' :-/ ------------------------------------------------------------------------ [2009-04-26 21:07:14] j...@php.net What if you pass proper parameters? "." as host is quite invalid.. ------------------------------------------------------------------------ [2009-04-26 18:31:40] andrew dot answer at gmail dot com Description: ------------ When mysql server setting up on WinXP machine with named pipe, mysql_connect called with '.' as host parameter anyway connect via tcp:// protocol. Reproduce code: --------------- When mysql server setting up on WinXP machine with options [client] pipe socket=mysql [mysqld] skip-networking enable-named-pipe socket=mysql php code like this: $link = mysql_connect('.','user','password'); if (!$link) { die('Could not connect: ' . mysql_error()); } else echo 'Connected successfully'; mysql_close($link); should connect via named pipes. But it's fail. Expected result: ---------------- Connected successfully Actual result: -------------- Could not connect: php_network_getaddresses: getaddrinfo failed: Ýòîò õîñò íåèçâåñòåí. php errorlog: [27-Apr-2009 01:28:06] PHP Warning: mysql_connect(): php_network_getaddresses: getaddrinfo failed: Ýòîò õîñò íåèçâåñòåí. in C:\sites\www\php.php on line 10 [27-Apr-2009 01:28:06] PHP Warning: mysql_connect(): [2002] php_network_getaddresses: getaddrinfo failed: Ýòîò õîñò íåèçâåñò (trying to connect via tcp://.:3306) in C:\sites\www\php.php on line 10 [27-Apr-2009 01:28:06] PHP Warning: mysql_connect(): php_network_getaddresses: getaddrinfo failed: Ýòîò õîñò íåèçâåñòåí. in C:\sites\www\php.php on line 10 ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=48082&edit=1