|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #68750 PDOMysql with mysqlnd does not allow the usage of named pipes
Submitted: 2015-01-05 15:54 UTC Modified: 2015-01-15 17:32 UTC
From: steffen at howarts dot info Assigned: ab (profile)
Status: Closed Package: PDO MySQL
PHP Version: 5.6.4 OS: Windows 8.1 6.3.9600
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.
Block user comment
Status: Assign to:
Bug Type:
From: steffen at howarts dot info
New email:
PHP Version: OS:


 [2015-01-05 15:54 UTC] steffen at howarts dot info
Mysql Server configured so that you can't use the default socket:

Connecting like isn't possible:

//this is the way it works with libmysql (with patch):
new PDO("mysql:host=.;unix_socket=abcdef") 

//this is the way how it works with mysqlnd (with patch):
//This seems to be very slow (5000ms without networking, while
//libmysql results in 20ms - which is probably a different bug)
new PDO("mysql:host=.;unix_socket=\\\\.\\pipe\\abcdef")

TLDR: The bug is that PDO mysql only checks 
for the unix-specific case of
while mysqlnd expects an explicit . for windows named pipes.


PDO_MYSQLWin32-001.patch (last revision 2015-01-05 15:55 UTC by steffen at howarts dot info)

Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2015-01-12 11:55 UTC]
-Status: Open +Status: Feedback
 [2015-01-12 11:55 UTC]

thanks for the patch. For the functionality it looks plausible, but I think using the "unix_socket" to pass a pipe is misleading. This should be called accordingly like "pipe" and only be available on Windows. But with such a change it'd probably aim master.

 [2015-01-12 12:26 UTC] steffen at howarts dot info
-Status: Feedback +Status: Open
 [2015-01-12 12:26 UTC] steffen at howarts dot info
It not really is when the mysqlnd driver is expecting it as such:
The variable in mysqlnd.c is explicitly named: "socket_or_pipe"

The whole mysql source tree shows this pattern as using the unix_socket as named pipe under windows.
 [2015-01-15 15:49 UTC]
Yes, internally. But i'm talking about how it's represented to outside, IMHO should be like

new PDO("mysql:host=.;named_pipe=\\\\.\\pipe\\abcdef")

But agreed, better to fix it now as is and maybe rename in master then. I'm going to apply your patch then.

 [2015-01-15 17:32 UTC]
-Status: Open +Status: Closed -Assigned To: +Assigned To: ab
 [2015-01-15 17:32 UTC]
Applied in 7c9633412e1598495dfe547071a2a1481bfc052b.

PHP Copyright © 2001-2019 The PHP Group
All rights reserved.
Last updated: Fri May 24 15:01:26 2019 UTC