Open the my. ini configuration file in the mysql database and find
Wait_timeout: the wait_timeout parameter is 5.
Wait_timeout = 5
This means that the connection will be automatically disconnected in 5 seconds, and the data submitted will come out of mysql server has gone away. Let's take a look at the solution.
Wait_timeout -- the number of seconds that mysql will wait before closing a non-interactive connection
Wait_timeout:
(1) if the size is set, the connection is closed quickly, so that some persistent connections do not work.
At that time, I set it
Wait_timeout = 300 is 300 seconds, so we can test again and find that there is no problem,
Supplement
Interactive_time -- refers to the number of seconds that mysql will wait before closing an interactive connection (for example, a connection in mysql gui tool)
(2) if the value is too large, it may take too long to open the connection. During show processlist, too many sleep connections can be seen, resulting in a too worker connections error.
(3) wait_timeout is generally expected to be as low as possible
The setting of interactive_timeout will have little impact on your web application.
Finally, some people on the Internet say this setting
Add or modify the following two variables in the my. cnf file:
Wait_timeout = 2880000
Interactive_timeout = 2880000
In this way, it is not responsible for how long it takes to configure wait_timeout = 2880000. It is a waste of performance, so you can set a proper one.