Bug #43812 [Com]: 'password' parameter in my.cnf not honored even with mysqli_options()

From: Date: Wed, 06 Jan 2016 19:11:35 +0000
Subject: Bug #43812 [Com]: 'password' parameter in my.cnf not honored even with mysqli_options()
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-198453@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=43812&edit=1

 ID:                 43812
 Comment by:         fms at hy dot com dot br
 Reported by:        graced at wingsnw dot com
 Summary:            'password' parameter in my.cnf not honored even with
                     mysqli_options()
 Status:             No Feedback
 Type:               Bug
 Package:            MySQLi related
 Operating System:   Debian lenny/sid
 PHP Version:        5.2.5
 Assigned To:        andrey
 Block user comment: N
 Private report:     N

 New Comment:

Same problem on 

FreeBSD 10.2-RELEASE
PHP 5.4.45 (cli) (built: Dec  8 2015 02:46:46)
Copyright (c) 1997-2014 The PHP Group
Zend Engine v2.4.0, Copyright (c) 1998-2014 Zend Technologies

Warning: mysqli::real_connect(): (HY000/1045): Access denied for user
''@'localhost' (using password: NO) in /usr/local/share/www/index.php on line 17


[client]
user="johndoe"
password="password-john"
host=127.0.0.1
port=3306
socket=/tmp/mysql.sock
database=customers
default-character-set=utf8


Previous Comments:
------------------------------------------------------------------------
[2015-02-26 16:47:48] ben at redsnapper dot net

This problem is reproducible and has nothing to do with the read-status of the my.cnf files. We are
seeing username,host,database all being set by the my.cnf file - but not the password value.  

mysqli_real_connect(): (28000/1045): Access denied for user
'special_u'@'101.202.185.245' (using password: NO)

We have tested the same file using mysql --defaults-extra-file=my.cnf  with no problems.

------------------------------------------------------------------------
[2009-07-27 06:36:23] axz55 at case dot edu

Also able to reproduce this using PHP 5.3.0

Verified that the username is being read from the file but the password is not. The file permissions
are 0400 and the mysql command line client reads the file just fine.

------------------------------------------------------------------------
[2008-07-22 01:00:01] 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".

------------------------------------------------------------------------
[2008-07-14 20:28:38] uw@php.net

I can't reproduce this with PHP 5.3 CVS nor with PHP 5.2.6, please check the notes on http://dev.mysql.com/doc/refman/5.1/en/option-files.html,
e.g. "On Unix platforms, MySQL ignores configuration files that are world-writable. This is
intentional as a security measure."



------------------------------------------------------------------------
[2008-01-15 05:03:13] graced at wingsnw dot com

Clarification: 

Warning: mysqli::real_connect(): (28000/1045): Access denied for user
'wadmin'@'localhost' (using password: NO) in /home/.../- on line 6

'wadmin' was the username I was connecting with (I missed it when sanitizing my.cnf
values), NOT my current login name (which is what PHP and mysql both default to otherwise).

Just in case it matters.

------------------------------------------------------------------------


The remainder of the comments for this report are too long. To view
the rest of the comments, please view the bug report online at

    https://bugs.php.net/bug.php?id=43812


--
Edit this bug report at https://bugs.php.net/bug.php?id=43812&edit=1


Thread (25 messages)

« previous php.bugs (#198453) next »