metricsign
Start free
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

  1. 1Step 1: Increase network timeouts: `SET GLOBAL net_read_timeout=600; SET GLOBAL net_write_timeout=600;`
  2. 2Step 2: Check MySQL and OS logs for OOM kills: `dmesg | grep -i 'killed process'`.
  3. 3Step 3: Optimize the query to reduce execution time and result set size.
  4. 4Step 4: Increase MySQL server memory or add swap space if OOM is the cause.

Frequently asked questions

What is the difference between MySQL error 2006 and 2013?

Error 2006 (server has gone away) typically occurs between queries due to idle timeout. Error 2013 occurs during an active query execution, usually due to network issues or server crash.

How do I prevent this when copying large MySQL tables in ADF?

Use ADF's partition option to split large table reads into smaller chunks, reducing individual query duration and the chance of hitting timeout limits.

Can MetricSign alert me when this error breaks a pipeline?

Yes — MetricSign triggers a pipeline_failed incident immediately when ADF loses the MySQL connection, so your team can investigate before reports go stale.

Official documentation: https://dev.mysql.com/doc/mysql-errors/8.0/en/server-error-reference.html

Other connection errors