Is pdo bug fixed?

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

Quote from this page , did anyone check if this is fixed?

+3
source share
3 answers

It's not a mistake. This is how MySQL is designed. When the host is "localhost", MySQL Unix clients use a Unix socket and not a TCP / IP socket to connect, so the TCP port does not matter.

Link: " 4.2.2 Connecting to a MySQL Server "

+13

PDO, . , psql ( PostgreSQL) localhost, UNIX, 127.0.0.1, TCP , , .

+3

In my humble opinion, you should check the pages associated with the PDO / PHP error.

But I do not think this is a mistake. If you are on a local host, you do not need to specify a port.

+1
source

Source: https://habr.com/ru/post/1737792/


All Articles