go to bug id or search bugs for
This probably shoudln't be filed under this 'type', but
there's not type of PDO as of yet (#pecl.php EFNet advised
this was the place to report PDO bugs these days)
There is no way (at least, no documented way) of
specifying the socket to use to connect to MySQL. I did
notice that unix_socket is used in the C code for the
module, but I couldn't set this via PHP.
Add a Patch
Add a Pull Request
Did you try this?
$pdo = new PDO("mysql:dbname=test;unix_socket=/path/to/socket/mysql.sock");
Yes, but it didn't work. Still got an exception:
Can't connect to local MySQL server though socket '' (2)
The socket's default value comes from mysql-config script and only if it is not found does it default to /tmp/mysql.sock.
I've tried Tony's example and it works flawlesly on latest CVS, picking up the unix-domain-socket path provided in the dsn.