MySQL Workbench allows users to increase the timeout limits for various reasons such as queries that might take a longer time to run and/or queries that are fetching/changing numerous amounts of data within a MySQL database and/or connections that are being attempted. Increasing the timeout limit will prevent such queries from being halted/dropped by MySQL and allow them to run until they reach the timeout limit designated to fulfill their purpose. It is recommended that the MySQL timeout settings are set to a high number to avoid any timeout errors.
Important: This guide is inaccurate if you're using an RDS instance such as an Amazon database in the Cloud. In cases like these, you would need to change the timeout limits directly from the Amazon console.
- Open MySQL Workbench.
- Click on ‘’Edit’’ in the top left corner followed by clicking on ‘’Preferences’’.
- Click on ‘’SQL Editor’’.
-
Change the necessary setting(s) listed down below:
- DBMS Connection Keep-Alive Interval (In Seconds) – The time interval between sending keep-alive messages to DBMS. Set to 0 to not send keep-alive messages.
- DBMS Connection Read Timeout Interval (In Seconds) – The maximum amount of time the query can take to return data from the DBMS. Set to 0 to skip the read timeout.
- DBMS Connection Timeout Interval (In Seconds) – Maximum time to wait before a connection attempt is aborted. - Click on ‘’OK’’ and restart the MySQL Workbench application for the changes to take effect.