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
