pdo - 这个pdo错误现在修复了吗?

标签 pdo port

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/

相关文章:

php - 使用 PHP 的大量 SQLite 插入

php - 使用 PHP 和 PDO 重定向链接

php - PDO Bind Params 取决于它们是否存在于查询中

c# - 如何获得使用 TcpClient 进行连接的基本应用程序?

javascript - nodejs EADDRINUSE 错误

linux - 用于端口路由的 docker ha 代理

php - 未显示最后一个 ID

php - 非 super 用户超出 postgresql php 连接限制

Python - 使用套接字设置源端口号

java - 如何在Spring Servlet中获取远程HTTP端口号?