php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #52140 mysql_connect uses wrong IP-address for error-messages of further connections
Submitted: 2010-06-22 11:34 UTC Modified: 2010-06-23 09:59 UTC
Votes:1
Avg. Score:1.0 ± 0.0
Reproduced:1 of 1 (100.0%)
Same Version:1 (100.0%)
Same OS:1 (100.0%)
From: cscholz at gsd-web dot de Assigned:
Status: Closed Package: MySQL related
PHP Version: 5.3.2 OS: Ubuntu 10.4
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: cscholz at gsd-web dot de
New email:
PHP Version: OS:

 

 [2010-06-22 11:34 UTC] 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

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2010-06-22 23:54 UTC] 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-23 00:12 UTC] johannes@php.net
-Status: Open +Status: Feedback
 [2010-06-23 09:59 UTC] cscholz at gsd-web dot de
-Status: Feedback +Status: Closed
 [2010-06-23 09:59 UTC] cscholz at gsd-web dot de
Johannes you are completely right, this was a brainfart - sorry!
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Tue Apr 30 13:01:32 2024 UTC