|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Request #62888 Support for more pdo_mysql.default_* configuration directives
Submitted: 2012-08-22 09:47 UTC Modified: 2017-04-24 19:23 UTC
Avg. Score:3.0 ± 0.0
Reproduced:1 of 1 (100.0%)
Same Version:0 (0.0%)
Same OS:0 (0.0%)
From: raphael dot droz+floss at gmail dot com Assigned:
Status: Open Package: PDO MySQL
PHP Version: 5.4.6 OS:
Private report: No CVE-ID: None
Have you experienced this issue?
Rate the importance of this bug to you:

 [2012-08-22 09:47 UTC] raphael dot droz+floss at gmail dot com
PDO currently supports the following directives:

PDO constructor ignores any of mysql[i].default_* directives.

Because it's both a missing feature and lacks consistency, supporting default_user, default_password (and why not default_host and default_port) would be great.

Defaulting to the corresponding mysql.* or mysqli.* directives according to the select DB driver may also be an option (while adding a bit more magic).

Stated that, as for mysql[i]_connect, these values are taken into account only if $user and $password are either NULL or omitted.

Test script:
// php_value	pdo_mysql.default_user	"test" // in httpd configuration
// or ini_set('pdo_mysql.default_user', 'test')
new PDO('mysql:host=localhost;dbname=test'); // $user and $password parameters omitted
// success


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2017-04-24 19:23 UTC]
-Package: PDO related +Package: PDO MySQL
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Fri Apr 12 22:01:29 2024 UTC