How to solve the error of server has gone away in mysql
This article is about how to solve server has gone away errors in mysql, the editor thinks it is very practical, so I share it with you to learn. I hope you can get something after reading this article.
During the operation, an error of mysql server has gone away may occur. This is caused by too large database, insufficient cache or operation timeout. You can modify the configuration of mysql to solve this problem:
1. Open the configuration file (shown here is the configuration file under brother Jun's lnmp. If your path is not this, find it yourself) CVM
Vi / etc/my.cnf
2. Find the two variables wait_timeout and interactive_timeout, and set the value to
Wait_timeout=2880000
Interactive_timeout = 2880000
If you don't have these two parameters, you can add them directly.
3. Find max_allowed_packet and increase the value of this variable, such as 100m (you can also set the size you want)
Max_allowed_packet = 100m
The max_allowed_packet parameter is used to control the maximum length of its communication buffer.
Of course, other parameters can be adjusted according to your own needs:
4. Restart the mysql service.
The above is how to solve the server has gone away errors in mysql. The editor believes that there are some knowledge points that we may see or use in our daily work. I hope you can learn more from this article. For more details, please follow the industry information channel.