|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #47594 'password' parameter in my.cnf not honored even with mysqli_options()
Submitted: 2009-03-08 00:23 UTC Modified: 2009-03-18 01:00 UTC
Avg. Score:5.0 ± 0.0
Reproduced:2 of 2 (100.0%)
Same Version:0 (0.0%)
Same OS:0 (0.0%)
From: jarrod dot makin at heartinternet dot co dot uk Assigned:
Status: No Feedback Package: MySQLi related
PHP Version: 5.2.9 OS: linux Centos 5.2
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 this is not your bug, you can add a comment by following this link.
If this is your bug, but you forgot your password, you can retrieve your password here.
Bug Type:
From: jarrod dot makin at heartinternet dot co dot uk
New email:
PHP Version: OS:


 [2009-03-08 00:23 UTC] jarrod dot makin at heartinternet dot co dot uk
Just like

OS: Centos 5.2
php: 5.2.8
msqli api: 5.1.30 

mysql  Ver 14.14 Distrib 5.1.30, for pc-linux-gnu (i686) using readline

Contents of my.cnf

user = web35-poker
host = localhost
password = password

database = web35-poker

Reproduce code:
$db = mysqli_init();

if ( mysqli_connect_errno() ) {
        printf("Connect failed: %s\n", mysqli_connect_error());

Expected result:
I expect $db to be a database handle

Actual result:
The following error message:
Connect failed: Access denied for user 'web35-poker'@'localhost' (using password: NO) 


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2009-03-10 10:26 UTC]
"On Unix platforms, MySQL ignores configuration files that are
world-writable. This is intentional as a security measure."

So check the permissions first.

 [2009-03-10 22:29 UTC] jarrod dot makin at heartinternet dot co dot uk
Good point. I should have detailed this in my message.
The file is 600, readable to just the script owner (it is running through suexec). The username part is read in and understood, however the password part appears to be ignored.
 [2009-03-18 01:00 UTC] php-bugs at lists dot php dot net
No feedback was provided for this bug for over a week, so it is
being suspended automatically. If you are able to provide the
information that was originally requested, please do so and change
the status of the bug back to "Open".
 [2010-10-16 13:08 UTC] john dot coll at csoft dot co dot uk
php 5.2.14
Linux lucian 2.6.9-89.29.1.EL #1 Tue Sep 28 09:26:45 EDT 2010 x86_64
exaclty the same problem
PHP Copyright © 2001-2023 The PHP Group
All rights reserved.
Last updated: Fri Jan 27 19:03:58 2023 UTC