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.
引自 this page , 有没有人验证过它是否已修复?
最佳答案
那不是错误。这就是 MySQL 的设计方式。当主机为“localhost”时,MySQL Unix 客户端使用 Unix 套接字,AKA Unix Domain Socket ,而不是用于连接的 TCP/IP 套接字,因此 TCP 端口无关紧要。
引用:“4.2.2. Connecting to the MySQL Server ”
关于pdo - 这个pdo错误现在修复了吗?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/2482411/