php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #39672 Cannot connect to socket
Submitted: 2006-11-29 00:59 UTC Modified: 2006-11-29 11:32 UTC
From: acct dot php at povpromotions dot com Assigned:
Status: Not a bug Package: PDO related
PHP Version: 5.2.0 OS: apache
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.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: acct dot php at povpromotions dot com
New email:
PHP Version: OS:

 

 [2006-11-29 00:59 UTC] acct dot php at povpromotions dot com
Description:
------------
My ISP has implemented both MySQL4 and MySQL5.  Because of this, I have to connect to the MySQL5 database using a socket port on the connect:  localhost:/tmp/mysql5.sock

However, PDO fails to connect when I use this.

I have tried both:

$dbH = new PDO('mysql:host=localhost:/tmp/mysql5.sock;dbname='.DBASE, DBUSER, DBPWORD );

$dbH = new PDO('mysql:host=localhost;port=/tmp/mysql5.sock;dbname='.DBASE, DBUSER, DBPWORD );

The first returns this error:
Exception message: SQLSTATE[HY000] [2005] Unknown MySQL server host 'localhost:/tmp/mysql5.sock'

The second returns this error:
SQLSTATE[00000] [1044] Access denied for user: '*****@localhost' to database '*****'
which means it is pointing to the old MySQL4 db and is not using the port.

I use many other connection methods that work fine with host="localhost:/tmp/mysql5.sock"

Any help would be appreciated.

dbrucas





Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2006-11-29 11:32 UTC] tony2001@php.net
http://www.php.net/manual/en/ref.pdo-mysql.connection.php

The PDO_MYSQL Data Source Name (DSN) is composed of the following elements: 
<.....>
unix_socket
The MySQL unix socket (shouldn't be used with host or port).
 
PHP Copyright © 2001-2021 The PHP Group
All rights reserved.
Last updated: Wed Mar 03 03:01:24 2021 UTC