php.net |  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
Votes:1
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
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: raphael dot droz+floss at gmail dot com
New email:
PHP Version: OS:

 

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

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



Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2017-04-24 19:23 UTC] adambaratz@php.net
-Package: PDO related +Package: PDO MySQL
 
PHP Copyright © 2001-2019 The PHP Group
All rights reserved.
Last updated: Sun Dec 15 00:01:22 2019 UTC