|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2005-04-30 12:58 UTC] sniper@php.net
[2005-05-08 01:00 UTC] php-bugs at lists dot php dot net
|
|||||||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Mon Oct 27 20:00:01 2025 UTC |
Description: ------------ using mysqli with a non-standart port, like 3307, it looses the database connection. i'm not sure if this happens only when using multiple instances of mysqli. the mysql server is fine, it must be a php problem/bug!! Reproduce code: --------------- $a = new mysqli('127.0.0.1','test1','abc','test1',3307); if (mysqli_connect_errno()) die("connect: failed with '".mysqli_connect_error()."'!"); printf("Host information: %s\n", $a->host_info); $r = $a->query('SHOW TABLES'); while ($v=$r->fetch_assoc()) print_r($v); $b = new mysqli('127.0.0.1','test2','abc','test2',3307); if (mysqli_connect_errno()) die("connect: failed with '".mysqli_connect_error()."'!"); printf("Host information: %s\n", $b->host_info); $r = $b->query('SHOW TABLES'); while ($v=$r->fetch_assoc()) print_r($v); -- $a = new mysqli('127.0.0.1','test1','abc','test1',3306); if (mysqli_connect_errno()) die("connect: failed with '".mysqli_connect_error()."'!"); printf("Host information: %s\n", $a->host_info); $r = $a->query('SHOW TABLES'); while ($v=$r->fetch_assoc()) print_r($v); $b = new mysqli('127.0.0.1','test2','abc','test2',3306); if (mysqli_connect_errno()) die("connect: failed with '".mysqli_connect_error()."'!"); printf("Host information: %s\n", $b->host_info); $r = $b->query('SHOW TABLES'); while ($v=$r->fetch_assoc()) print_r($v); Expected result: ---------------- in both cases something like Host information: 127.0.0.1 via TCP/IP Array (...) Host information: 127.0.0.1 via TCP/IP Array (...) Actual result: -------------- Warning: mysqli::mysqli() [function.mysqli]: Lost connection to MySQL server during query in /test/mysqli.php on line 2 connect: failed with 'Lost connection to MySQL server during query'!