Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is this pdo bug fixed now?

Tags:

port

pdo

Note that you can specify a port number with "port=####", but this port number will be ignored if the host is localhost. If you want to connect to a local port other than the default, use host=127.0.0.1 instead of localhost.

Quoted from this page,has anyone verified if it has been fixed?

like image 561
user198729 Avatar asked Mar 20 '10 08:03

user198729


1 Answers

That isn't a bug. That is how MySQL is designed. When the host is "localhost", MySQL Unix clients use a Unix socket, AKA Unix Domain Socket, rather than a TCP/IP socket for the connection, thus the TCP port doesn't matter.

Reference: "4.2.2. Connecting to the MySQL Server"

like image 116
outis Avatar answered Jan 03 '23 15:01

outis