# How do I fix the "Lost Connection" error when issuing a query on MySQL? ``` ERROR 2013 (HY000) at line xx: Lost connection to MySQL server during query ``` A `Lost Connection` error occurs when: - You have network connectivity issues. - Your query is taking too long to complete. If you are consistently getting this error and queries are taking longer than 30 seconds (the default value for MySQL’s [`net_read_timeout` variable](https://dev.mysql.com/doc/refman/8.0/en/server-system-variables.html#sysvar_net_read_timeout)) to complete: - Check for network connectivity issues. - Revise your query to not send as much data, and therefore be faster. - Split your query into multiple smaller queries. ## Related Topics [How do I fix the "Out of sort memory" error?](https://docs.digitalocean.com/support/how-do-i-fix-the-out-of-sort-memory-error/index.html.md): Adjust the sort\_buffer\_size value while assessing its impact on memory consumption and query performance. [How do I fix the "Host is Blocked" error when connecting to MySQL?](https://docs.digitalocean.com/support/how-do-i-fix-the-host-is-blocked-error-when-connecting-to-mysql/index.html.md): Check for query timeouts and ensure your network connection is stable. [How do I fix the mysqldump "Couldn't execute FLUSH TABLES Access denied" error?](https://docs.digitalocean.com/support/how-do-i-fix-the-mysqldump-couldnt-execute-flush-tables-access-denied-error/index.html.md): Update backup user permissions, remove the –single-transaction flag, or downgrade mysqldump.