开发者

Is this pdo bug fixed now?

Note that you can specify 开发者_StackOverflowa 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?


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"


That's most likely not a bug in PDO, but a feature of some database client library. For example, if you use psql (the PostgreSQL client) to connect to localhost, it will use UNIX sockets, but if you use 127.0.0.1, it will use TCP sockets and for that it obviously needs also the port number.


In my humble opinion you should be checking the PDO/PHP bug related pages.

But i don't think it's a bug. If you are on localhost you don't have to specify a port.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜