I use comet in my website.. The long polling script returns "Mysql has gone away" error often...
I have used mysqli extension (object-oriented) to connect php with mysql database
even php *mysqli -> ping()*
method doesn't fix this problem.
The best part of this is the error did not occur for two months i was using this website with comet But now it occurres....
Tips: I changed mysql database's collation to utfmb4_unicode_ci and charset to utbmb4
How can i fix this?
You need to check below thinks in my.cnf
check that wait_timeout mysql variable in your my.cnf configuration file is large enough.
Also check max_allowed_packet
set max_allowed_packet = 128M,
then restart your MySQL server
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.