#39672 [Opn->Bgs]: Cannot connect to socket

From: Date: Wed, 29 Nov 2006 11:32:03 +0000
Subject: #39672 [Opn->Bgs]: Cannot connect to socket
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-105680@lists.php.net to get a copy of this message
 ID:               39672
 Updated by:       tony2001@php.net
 Reported By:      acct dot php at povpromotions dot com
-Status:           Open
+Status:           Bogus
 Bug Type:         PDO related
 Operating System: apache
 PHP Version:      5.2.0
 New Comment:

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).


Previous Comments:
------------------------------------------------------------------------

[2006-11-29 00:59:27] 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






------------------------------------------------------------------------


-- 
Edit this bug report at http://bugs.php.net/?id=39672&edit=1


Thread (2 messages)

« previous php.bugs (#105680) next »