mysql errno 32_mysql_pconnect(): send of 5 bytes failed with errno=32 Broken pipe

I am using PHP 5.6.20, PDO (throwing exceptions only), and MySQL 5.6.28 with persistent connections and EVERYTHING is utf8mb4. My entire stack is set up for utf-8 (dsn string settings, connections, database server databases, tables, columns, Apache 2.4.12, PHP, all webpages, CSS ... you name it).

I get the following error message intermittently and it is mystifying and annoying.

Notice: PDO::__construct(): send of 5 bytes failed with errno=32 Broken pipe in file /foo/bar/baz

Assuming a persistent connection is a noninteractive one, the MySQL 5.6 manual (5.1.4 Server System Variables) says the following about the server system variable wait_timeout. The number of seconds the server waits for activity on a noninteractive connection before closing it.

Default: 28800 sec

(28000 sec / 1) * (1 hour / 3600 sec) = 8 hours

Max: 31536000 sec ((31536000sec/1)*(1hr/3600sec)*(1day/24hrs)=365days

Therefore, check wait_timeout in your my.cnf and decide if persistent connections are what you need. Also, you'll have to invest in making your application more robust to account for a persistent connection that has been torn down. Clearly, you do not want your client to come back the next day (having gone home for the night) and say "What the heck?!"

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值