Lost Connection Error
One of the more common errors you’ll encounter while running a lengthy or tricky query on MySQL and is often experienced while mysqldump is up and running on a pretty extensive database is:
Error 2013: Lost connection to MySQL server during query
This error can be easily fixed by just simply updating the default MySQL query timeout limits
Display MySQL Timeout Variables
First, you must check their current values before changing these variables by just simply running:
wait_timeout: is basically the number of seconds the server waits for activity on a noninteractive connection before closing it, while interactive_timeout: The number of seconds the server remains for activity on an interactive connection before closing it.
And the default value is always 28800 seconds (8 Hours)
Update MySQL Timeout
Now if the queries you’re working on require a little bit more time, you can change the values and you must change their value in seconds, for example, you need 24 hours for your query:
And just like that, You’ve updated your MySQL timeout easily. And if you want to make managing your data hassle-free and easy, Ottomatik can help you with automated backups to help you manage your databases efficiently and stress-free! Try Ottomatik free for 14 days and see a world of difference when backing up your servers.