php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #60155 pdo_mysql.default_socket ignored
Submitted: 2011-10-28 01:22 UTC Modified: 2011-11-02 15:46 UTC
From: gnoodl+php at gmail dot com Assigned: johannes (profile)
Status: Closed Package: PDO related
PHP Version: 5.3.8 OS: Linux (Ubuntu)
Private report: No CVE-ID: None
 [2011-10-28 01:22 UTC] gnoodl+php at gmail dot com
Description:
------------
The `pdo_mysql.default_socket` configuration setting is ignored when creating a 
PDO MySQL connection to "localhost"

On my system, `pdo_mysql.default_socket` is set to "/var/run/mysqld/mysqld.sock"

I've created a proof of concept here - http://staging.philipbrown.id.au/pdo-
test.php

Test script:
---------------
$db = new PDO('mysql:host=localhost;dbname=test', 'pdotest', 'pdotest');
echo $db->getAttribute(PDO::ATTR_SERVER_VERSION);


Expected result:
----------------
Expect to see MySQL server version, eg "5.1.37-1ubuntu5.5"

Actual result:
--------------
PDOException with message "SQLSTATE[HY000] [2002] Can't connect to local MySQL 
server through socket '/tmp/mysql.sock' (2)"

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2011-11-02 15:45 UTC] johannes@php.net
Automatic comment from SVN on behalf of johannes
Revision: http://svn.php.net/viewvc/?view=revision&revision=318696
Log: - Fix bug #60155 (pdo_mysql.default_socket ignored).
 [2011-11-02 15:46 UTC] johannes@php.net
This bug has been fixed in SVN.

Snapshots of the sources are packaged every three hours; this change
will be in the next snapshot. You can grab the snapshot at
http://snaps.php.net/.

 For Windows:

http://windows.php.net/snapshots/
 
Thank you for the report, and for helping us make PHP better.

This option existed always but has only been used with myslqnd. Works for libmysql now, too.
 [2011-11-02 15:46 UTC] johannes@php.net
-Status: Open +Status: Closed -Assigned To: +Assigned To: johannes
 [2012-04-18 09:48 UTC] laruence@php.net
Automatic comment on behalf of johannes
Revision: http://git.php.net/?p=php-src.git;a=commit;h=026445a0aa2f9865dac89e3bdfec1a4c9183913a
Log: - Fix bug #60155 (pdo_mysql.default_socket ignored).
 [2012-07-24 23:39 UTC] rasmus@php.net
Automatic comment on behalf of johannes
Revision: http://git.php.net/?p=php-src.git;a=commit;h=026445a0aa2f9865dac89e3bdfec1a4c9183913a
Log: - Fix bug #60155 (pdo_mysql.default_socket ignored).
 [2013-11-17 09:35 UTC] laruence@php.net
Automatic comment on behalf of johannes
Revision: http://git.php.net/?p=php-src.git;a=commit;h=026445a0aa2f9865dac89e3bdfec1a4c9183913a
Log: - Fix bug #60155 (pdo_mysql.default_socket ignored).
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Tue Mar 19 06:01:30 2024 UTC