简体   繁体   English

无法在php fork中启动mysql事务

[英]Cannot start mysql transaction in php fork

I have problem when start mysql transaction in child process with php pcntl_fork. 使用php pcntl_fork在子进程中启动mysql事务时出现问题。 The error message is: 错误消息是:

PDO::beginTransaction(): send of 22 bytes failed with errno=32 Broken pipe

How to start transaction in child process with pcntl_fork 如何使用pcntl_fork在子进程中启动事务

Thank you 谢谢

If someone is struggling with this issue, here is the fix: 如果有人为此问题苦苦挣扎,请使用以下解决方法:

Try changing/setting up wait_timeout in your mysql my.cnf config file: 尝试在mysql my.cnf配置文件中更改/设置wait_timeout:

wait_timeout=3600

This config file is located in the /etc/mysql/my.cnf (Ubuntu/Debian) and /usr/local/mysql/my.cnf (OSX). 该配置文件位于/etc/mysql/my.cnf(Ubuntu / Debian)和/usr/local/mysql/my.cnf(OSX )中。

Restart mysql server and it should work. 重新启动mysql服务器,它应该可以工作。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM