Resolving the "Lost Connection to MySQL Server During Query" Error
Adding an index to a MySQL table in Workbench can sometimes result in the error "Error Code: 2013. Lost connection to MySQL server during query," particularly with lengthy queries. Here's how to fix it:
Solution: Extending the Connection Timeout
Modern MySQL Workbench versions offer a configurable connection timeout. To change this setting:
<code>Go to Edit → Preferences → SQL Editor → DBMS connection read time out (in seconds):</code>
Increase the timeout, for example, to 6000 seconds.
Additional Troubleshooting Steps
The above is the detailed content of How to Fix 'Lost Connection to MySQL Server During Query' Error in Workbench?. For more information, please follow other related articles on the PHP Chinese website!