How do I fix the "Out of sort memory" error?
Adjust the sort_buffer_size value while assessing its impact on memory consumption and query performance.
Validated on 20 Nov 2024 • Last edited on 6 Dec 2024
ERROR 2013 (HY000) at line xx: Lost connection to MySQL server during query
A Lost Connection
error occurs when:
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) to complete:
Adjust the sort_buffer_size value while assessing its impact on memory consumption and query performance.
Check for query timeouts and ensure your network connection is stable.
Update backup user permissions, remove the –single-transaction flag, or downgrade mysqldump.
Try using different keywords or simplifying your search terms.