|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Request #78033 PDO - support username & password specified in DSN
Submitted: 2019-05-19 12:59 UTC Modified: 2019-07-02 10:42 UTC
From: sjon at hortensius dot net Assigned: sjon (profile)
Status: Closed Package: PDO Core
PHP Version: 7.4.0alpha3 OS: Irrelevant
Private report: No CVE-ID: None
View Add Comment Developer Edit
Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know!
Just going to say 'Me too!'? Don't clutter the database with that please !
Your email address:
Solve the problem:
35 + 3 = ?
Subscribe to this entry?

 [2019-05-19 12:59 UTC] sjon at hortensius dot net
PDO should support user and password being specified in the DSN instead of separate constructor parameters. This can be implemented backwards compatible, by ignoring the credentials in DSN when separate constructor parameters are passed.

This additionally allows a security feature where user-space is unable to read the credentials but PDO is able to connect anyway.

Test script:
Implementation in


Add a Patch

Pull Requests

Pull requests:

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2019-05-19 13:00 UTC]
-Status: Open +Status: Assigned -Assigned To: +Assigned To: sjon
 [2019-05-19 13:51 UTC]
The following pull request has been associated:

Patch Name: PDO - support username & password specified in DSN
On GitHub:
 [2019-07-02 10:42 UTC]
-Status: Assigned +Status: Closed -PHP Version: Next Major Version +PHP Version: 7.4.0alpha3
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Wed Feb 21 19:01:29 2024 UTC