gpt4 book ai didi

php - PDO::__construct():发送 108 个字节失败,errno=32 Broken pipe

转载 作者:可可西里 更新时间:2023-11-01 06:52:22 24 4
gpt4 key购买 nike

当我登录到我的命令行 mysql 时,我无法再访问任何需要数据库连接的 PHP 应用程序。每次都会发生这种情况。在我的本地主机上导致问题的步骤:

Command line:
mysql -u root (no password for localhost)
mysql>

此时我不执行或做任何事情。我使用 root 加载任何需要数据库连接的页面:

PDO::__construct(): send of 108 bytes failed with errno=32 Broken pipe

如果我退出 mysql,页面会返回,但在尝试同时加载两个页面(在浏览器选项卡中)时出现另一个问题,这将导致其中一个页面中断,直到页面加载,然后我可以刷新

My.cnf:

sql_mode=NO_ENGINE_SUBSTITUTION,STRICT_TRANS_TABLES

wait_timeout=5000
max_allowed_packet=100m
max_user_connections=1000

最佳答案

在你的 MySQL my.cnf 配置文件中设置 wait_timeout:

wait_timeout=3600

此配置文件位于 /etc/mysql/my.cnf (Ubuntu/Debian) 和 /usr/local/mysql/my.cnf (OSX ) 和 /location of server bin folder/mysql/my.cnf for windows.

重新启动 MySQL 服务器并检查它是否正常工作。

关于php - PDO::__construct():发送 108 个字节失败,errno=32 Broken pipe,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/29169417/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com