High severityconnection
Power BI Refresh Error:
2013
What does this error mean?
The connection to MySQL was lost while a query was executing — different from 2006 which occurs between queries.
Common causes
- 1Network instability between the client and MySQL server during a long-running query
- 2The MySQL server ran out of memory and was killed by the OS OOM killer
- 3The query exceeded net_read_timeout or net_write_timeout
- 4A large result set overwhelmed network buffers causing the connection to be dropped
How to fix it
- 1Step 1: Increase network timeouts: `SET GLOBAL net_read_timeout=600; SET GLOBAL net_write_timeout=600;`
- 2Step 2: Check MySQL and OS logs for OOM kills: `dmesg | grep -i 'killed process'`.
- 3Step 3: Optimize the query to reduce execution time and result set size.
- 4Step 4: Increase MySQL server memory or add swap space if OOM is the cause.
Frequently asked questions
Official documentation: https://dev.mysql.com/doc/mysql-errors/8.0/en/server-error-reference.html