#43812 [NEW]: 'password' parameter in my.cnf not honored even with mysqli_options()
From: graced at wingsnw dot com
Operating system: Debian lenny/sid
PHP version: 5.2.5
PHP Bug Type: MySQLi related
Bug description: 'password' parameter in my.cnf not honored even with mysqli_options()
Description:
------------
my.cnf files allow the username/password/hostname and other connection
information to be stored for later use.
The Mysqli extension accepts a username from the file (overriding the
default of the current login username) but not a password, thus it attempts
to connect with no password even when a password is specified. The mysql
command line client, when pointed at the file using
--defaults-extra-file=path/to/file.cnf, successfully connects.
Reproduce code:
---------------
my.cnf contents:
[client]
host = localhost
user = "username"
password = "topsecret"
PHP script:
<?php
error_reporting(E_ALL);
$DB = mysqli_init();
$DB->options(MYSQLI_READ_DEFAULT_FILE, "my.cnf");
$DB->options(MYSQLI_READ_DEFAULT_GROUP, "client");
$DB->real_connect();
Expected result:
----------------
A successful database connection.
Actual result:
--------------
Warning: mysqli::real_connect(): (28000/1045): Access denied for user
'wadmin'@'localhost' (using password: NO) in /home/.../- on line 6
--
Edit bug report at http://bugs.php.net/?id=43812&edit=1
--
Try a CVS snapshot (PHP 4.4): http://bugs.php.net/fix.php?id=43812&r=trysnapshot44
Try a CVS snapshot (PHP 5.2): http://bugs.php.net/fix.php?id=43812&r=trysnapshot52
Try a CVS snapshot (PHP 5.3): http://bugs.php.net/fix.php?id=43812&r=trysnapshot53
Try a CVS snapshot (PHP 6.0): http://bugs.php.net/fix.php?id=43812&r=trysnapshot60
Fixed in CVS: http://bugs.php.net/fix.php?id=43812&r=fixedcvs
Fixed in release: http://bugs.php.net/fix.php?id=43812&r=alreadyfixed
Need backtrace: http://bugs.php.net/fix.php?id=43812&r=needtrace
Need Reproduce Script: http://bugs.php.net/fix.php?id=43812&r=needscript
Try newer version: http://bugs.php.net/fix.php?id=43812&r=oldversion
Not developer issue: http://bugs.php.net/fix.php?id=43812&r=support
Expected behavior: http://bugs.php.net/fix.php?id=43812&r=notwrong
Not enough info: http://bugs.php.net/fix.php?id=43812&r=notenoughinfo
Submitted twice: http://bugs.php.net/fix.php?id=43812&r=submittedtwice
register_globals: http://bugs.php.net/fix.php?id=43812&r=globals
PHP 3 support discontinued: http://bugs.php.net/fix.php?id=43812&r=php3
Daylight Savings: http://bugs.php.net/fix.php?id=43812&r=dst
IIS Stability: http://bugs.php.net/fix.php?id=43812&r=isapi
Install GNU Sed: http://bugs.php.net/fix.php?id=43812&r=gnused
Floating point limitations: http://bugs.php.net/fix.php?id=43812&r=float
No Zend Extensions: http://bugs.php.net/fix.php?id=43812&r=nozend
MySQL Configuration Error: http://bugs.php.net/fix.php?id=43812&r=mysqlcfg
Thread (25 messages)
- graced at wingsnw dot com
- tony2001@php.net#43812 [Opn->Asn]: 'password' parameter in my.cnf not honored even with mysqli_options()
- graced at wingsnw dot com#43812 [Asn]: 'password' parameter in my.cnf not honored even with mysqli_options()
- uw@php.net#43812 [Asn->Fbk]: 'password' parameter in my.cnf not honored even with mysqli_options()
- jarrod dot makin at heartinternet dot co dot uk#43812 [Com]: 'password' parameter in my.cnf not honored even with mysqli_options()
- axz55 at case dot edu#43812 [Com]: 'password' parameter in my.cnf not honored even with mysqli_options()
- ben at redsnapper dot netBug #43812 [Com]: 'password' parameter in my.cnf not honored even with mysqli_options()
- fms at hy dot com dot brBug #43812 [Com]: 'password' parameter in my.cnf not honored even with mysqli_options()
- requinix@php.netBug #43812 [NoF]: 'password' parameter in my.cnf not honored even with mysqli_options()
- ben at redsnapper dot netBug #43812 [Com]: 'password' parameter in my.cnf not honored even with mysqli_options()
- requinix@php.netBug #43812 [NoF]: 'password' parameter in my.cnf not honored even with mysqli_options()
- ben at redsnapper dot netBug #43812 [Com]: 'password' parameter in my.cnf not honored even with mysqli_options()
- requinix@php.netBug #43812 [NoF]: 'password' parameter in my.cnf not honored even with mysqli_options()
- requinix@php.netBug #43812 [NoF->Fbk]: 'password' parameter in my.cnf not honored even with mysqli_options()
- ben at redsnapper dot netBug #43812 [Com]: 'password' parameter in my.cnf not honored even with mysqli_options()
- php-bugs at lists dot php dot netBug #43812 [Fbk->NoF]: 'password' parameter in my.cnf not honored even with mysqli_options()
- requinix@php.netBug #43812 [NoF->ReO]: 'password' parameter in my.cnf not honored even with mysqli_options()
- hsc@php.netBug #43812 [Com]: 'password' parameter in my.cnf not honored even with mysqli_options()
- juan at verdnatura dot esBug #43812 [Com]: 'password' parameter in my.cnf not honored even with mysqli_options()
- fjanisze@php.netBug #43812 [ReO->Fbk]: 'password' parameter in my.cnf not honored even with mysqli_options()
- ben at redsnapper dot netBug #43812 [Com]: 'password' parameter in my.cnf not honored even with mysqli_options()
- ben at redsnapper dot netBug #43812 [Com]: 'password' parameter in my.cnf not honored even with mysqli_options()
- php-bugs at lists dot php dot netBug #43812 [Fbk->NoF]: 'password' parameter in my.cnf not honored even with mysqli_options()
- requinix@php.netBug #43812 [NoF->Opn]: 'password' parameter in my.cnf not honored even with mysqli_options()
- nikic@php.netBug #43812 [Opn]: MYSQLI_READ_DEFAULT_FILE option ignored when using mysqlnd