Bug #52140 [Opn->Fbk]: mysql_connect uses wrong IP-address for error-messages of further connections
| From: | johannes@php.net | Date: | Tue, 22 Jun 2010 22:12:21 +0000 |
| Subject: | Bug #52140 [Opn->Fbk]: mysql_connect uses wrong IP-address for error-messages of further connections | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-151776@lists.php.net to get a copy of this message | ||
Edit report at http://bugs.php.net/bug.php?id=52140&edit=1
ID: 52140
Updated by: johannes@php.net
Reported by: cscholz at gsd-web dot de
Summary: mysql_connect uses wrong IP-address for error-messages
of further connections
-Status: Open
+Status: Feedback
Type: Bug
Package: MySQL related
Operating System: Ubuntu 10.4
PHP Version: 5.3.2
Previous Comments:
------------------------------------------------------------------------
[2010-06-22 23:54:45] johannes@php.net
The error message should contain the IP address of the host running PHP
as it is used for authentication by MySQL. Is 192.168.0. The IP of the
web server?
------------------------------------------------------------------------
[2010-06-22 11:34:21] cscholz at gsd-web dot de
Description:
------------
When doing more than one mysql_connect the error message will return the
wrong ip-address in the reply if subsequent connections use a different
IP.
This bug is also true for mysqli_connect by the way.
Test script:
---------------
<?
mysql_connect ( '192.168.0.1' , 'valid user' , 'valid password' );
mysql_connect ( '192.168.0.2' , 'invalid user' , 'or invalid password'
);
?>
Expected result:
----------------
Warning: mysql_connect() [function.mysql-connect]: Access denied for
user 'invalid user'@'192.168.0.2' (using password: YES) in thecode.php
on line 4
Actual result:
--------------
Warning: mysql_connect() [function.mysql-connect]: Access denied for
user 'invalid user'@'192.168.0.1' (using password: YES) in thecode.php
on line 4
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/bug.php?id=52140&edit=1