#34988 [Opn->Bgs]: PDO_Mysql, hardcoded socket to /tmp/mysql.sock

From: Date: Wed, 26 Oct 2005 13:55:22 +0000
Subject: #34988 [Opn->Bgs]: PDO_Mysql, hardcoded socket to /tmp/mysql.sock
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-87093@lists.php.net to get a copy of this message
ID: 34988 Updated by: iliaa@php.net Reported By: pookey at pookey dot co dot uk -Status: Open +Status: Bogus Bug Type: PDO related Operating System: * PHP Version: 5.1.0RC3 New Comment: 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. Previous Comments: ------------------------------------------------------------------------ [2005-10-26 11:05:34] pookey at pookey dot co dot uk Yes, but it didn't work. Still got an exception: Can't connect to local MySQL server though socket '' (2) ------------------------------------------------------------------------ [2005-10-26 10:56:02] tony2001@php.net Did you try this? <?php $pdo = new PDO("mysql:dbname=test;unix_socket=/path/to/socket/mysql.sock"); ?> ------------------------------------------------------------------------ [2005-10-26 10:14:30] pookey at pookey dot co dot uk Description: ------------ 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. ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=34988&edit=1

« previous php.bugs (#87093) next »