Please refer to the following steps to change the MySQL timeout error –
1. Log in to your server root or sudo user using SSH.
2. Open the MySQL configuration file, my.cnf, with your preferred editor.
$ sudo vi /etc/my.cnf
3. Find the timeout configuration in my.cnf and change the required setting.
wait_timeout = 2880
interactive_timeout = 2880
4. Save and close my.cnf file.
5. Restart the MySQL service to apply the changes.
$ sudo /etc/init.d/mysql restart