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
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If this is not your bug, you can add a comment by following this link.
If this is your bug, but you forgot your password, you can retrieve your password here.
Password:
Status:
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-2024 The PHP Group
All rights reserved.
Last updated: Thu Mar 28 12:01:27 2024 UTC