|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #63386 mysqli_connect_error may not include username
Submitted: 2012-10-29 16:15 UTC Modified: 2013-01-30 16:14 UTC
Avg. Score:3.0 ± 0.0
Reproduced:1 of 1 (100.0%)
Same Version:1 (100.0%)
Same OS:0 (0.0%)
From: mark at invisionpower dot com Assigned:
Status: Not a bug Package: MySQLi related
PHP Version: 5.4.8 OS: OS X 10.8.2
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.
Block user comment
Status: Assign to:
Bug Type:
From: mark at invisionpower dot com
New email:
PHP Version: OS:


 [2012-10-29 16:15 UTC] mark at invisionpower dot com
If attempting to connect to a database using the MySQL Improved Extension using a 
username but a blank password, and that user does not exist, the error message 
does not specify the attempted username.

See attached test script and expected/actual output.

Test script:
$mysqli = new mysqli( 'localhost', 'foo', '', 'dbname' );
echo $mysqli->connect_error;

Expected result:
Access denied for user 'foo'@'localhost' to database 'dbname'

Actual result:
Access denied for user ''@'localhost' to database 'dbname'


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2013-01-30 16:14 UTC]
-Status: Open +Status: Not a bug
 [2013-01-30 16:14 UTC]
This is not API related. This message comes from the server and is shown to you "as-is". If you don't like it, please file a bug at requesting the server to improve its error message.
PHP Copyright © 2001-2022 The PHP Group
All rights reserved.
Last updated: Fri Dec 02 17:05:52 2022 UTC