|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Request #38144 mysqli_real_connect
Submitted: 2006-07-19 15:30 UTC Modified: 2017-04-13 13:13 UTC
Avg. Score:5.0 ± 0.0
Reproduced:2 of 2 (100.0%)
Same Version:1 (50.0%)
Same OS:0 (0.0%)
From: Assigned: mysql (profile)
Status: Closed Package: MySQLi related
PHP Version: 5CVS-2006-07-19 (CVS) OS: CentOS 4
Private report: No CVE-ID: None
 [2006-07-19 15:30 UTC]
the mysql client libs allow using a user specified "my.cnf".
Such a configfile can already be set with mysqli_options and MYSQLI_READ_DEFAULT_FILE.
The configfile can contain a password for connections. Such a password is only read, if the password-parameter to the mysql_real_connect c-function is NULL.
Passing NULL as password to mysqli_real_connect gets converted to an empty string during zend_parse_method_parameters, so the configfile is not used for a password.
At is a tiny patch to allow NULL-values for the password. This patch is against 5.2.
After patching the following works:

$mysqli = mysqli_init();
/*pass NULL as user/pass so that the values in the config-file are used*/


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2011-01-01 23:41 UTC]
-Package: Feature/Change Request +Package: MySQLi related
 [2011-01-06 15:05 UTC]
-Status: Open +Status: Assigned -Assigned To: +Assigned To: mysql
 [2011-01-06 15:05 UTC]
I'm no fan of it. mysqlnd does not support client config files anyway.
 [2017-04-13 13:13 UTC]
-Status: Assigned +Status: Closed
 [2017-04-13 13:13 UTC]
This problem is not reproducible anymore in recent releases, NULL can be submitted as username/pass and the config file will be then used.
PHP Copyright © 2001-2017 The PHP Group
All rights reserved.
Last updated: Sun Nov 19 01:31:42 2017 UTC