Open DevilSerj opened 1 month ago
Code Try to reconnect to the database.
https://github.com/swoole/swoole-src/issues/4131#issuecomment-815353916
more info : https://github.com/jingjingxyk/swoole-cli/issues/125
Code Try to reconnect to the database.
more info : jingjingxyk/swoole-cli#125
Of course I understand this and I have tried many different options and reconnect as well. But it doesn't work for me, the connection is bigger, I easily use the query method and it works. I have a task that creates coroutines and I need to have a separate connection within the coroutine and I was thinking of doing it using Swoole/Coroutine/Mysql as I expected it to work better. But it doesn't work for me and I used a normal pdo and just create a meal through it.
Maybe I should update swoole and php but now I can't do it yet.
Are you using connection pool outside of that example you gave above? Maybe you've hit your server limit and that's why you can't create additional connections?
Please answer these questions before submitting your issue.
What did you do? If possible, provide a simple script for reproducing the error.
What did you expect to see? A positive result prepare
What did you see instead? connect bool(true) prepare [1] bool(false) int(2006) string(77) "SQLSTATE[HY000] [2006] MySQL server has gone away due to Connection timed out"
What version of Swoole are you using (show your
php --ri swoole
)? PHP | 7.4.33 | Swoole | 4.8.13 |What is your machine environment used (show your
uname -a
&php -v
&gcc -v
) ? Linux