This is occurring by two main causes:
- If mysql query waiting time is low
- If mysql query length is high
How to fix this problem:
- To fix waiting time, Check that “wait_timeout” into you’re my.cnf configuration and increase time.
- To fix query high length, if your packet is too large or incorrect, It may show error. So you can increase packet size like max_allowed_packet in my.cnf file.