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
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
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

Pull Requests

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-2025 The PHP Group
All rights reserved.
Last updated: Tue Jul 01 20:01:36 2025 UTC