ID: 50992 Updated by: johan...@php.net Reported By: gert-rainer dot bitterlich at ima-dresden dot de -Status: Open +Status: Bogus Bug Type: MySQLi related Operating System: Windows 7 64bit PHP Version: 5.3.1 New Comment:
Please do not submit the same bug more than once. An existing bug report already describes this very problem. Even if you feel that your issue is somewhat different, the resolution is likely to be the same. Thank you for your interest in PHP. There's nothing we can do. Please use 127.0.0.1 or configure your systme to use IPv4 127.0.0.1, not IPv6 [::1] for localhost. Previous Comments: ------------------------------------------------------------------------ [2010-02-10 12:19:08] gert-rainer dot bitterlich at ima-dresden dot de Description: ------------ The connect to the MySQL database (V5.1.x) faild with PHP 5.3.1 (also with PHP 5.3.2RC1), when I use a real servername, like localhost or the PC name. If I use the IP address it works fine. With PHP 5.3.0 it was OK. Reproduce code: --------------- <?php $sHost = 'localhost'; echo'<pre>Host = '.$sHost.'</pre>'; $link = mysqli_init(); if (!$link) { die('mysqli_init failed'); } if (!mysqli_options($link, MYSQLI_INIT_COMMAND, 'SET AUTOCOMMIT = 0')) { die('Setting MYSQLI_INIT_COMMAND failed'); } if (!mysqli_options($link, MYSQLI_OPT_CONNECT_TIMEOUT, 5)) { die('Setting MYSQLI_OPT_CONNECT_TIMEOUT failed'); } if (!mysqli_real_connect($link, $sHost, 'root', 'xitami', 'kb_globals')) { die('Connect Error (' . mysqli_connect_errno() . ') ' . mysqli_connect_error()); } echo 'Success... ' . mysqli_get_host_info($link) . "\n"; mysqli_close($link); ?> Expected result: ---------------- Host = localhost Success... localhost via TCP/IP Actual result: -------------- Host = localhost Warning: mysqli_real_connect() [function.mysqli-real-connect]: [2002] Ein Verbindungsversuch ist fehlgeschlagen, da die Gegenstelle na (trying to connect via tcp://localhost:3306) in D:\Inetpub\wwwroot\php\test\test_mysqli.php on line 20 Warning: mysqli_real_connect() [function.mysqli-real-connect]: (HY000/2002): Ein Verbindungsversuch ist fehlgeschlagen, da die Gegenstelle nach einer bestimmten Zeitspanne nicht richtig reagiert hat, oder die hergestellte Verbindung war fehlerhaft, da der verbundene Host nicht reagiert hat. in D:\Inetpub\wwwroot\php\test\test_mysqli.php on line 20 Connect Error (2002) Ein Verbindungsversuch ist fehlgeschlagen, da die Gegenstelle nach einer bestimmten Zeitspanne nicht richtig reagiert hat, oder die hergestellte Verbindung war fehlerhaft, da der verbundene Host nicht reagiert hat. ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=50992&edit=1