metricsign
Start free
Critical severityconnection

Power BI Refresh Error:
1040

What does this error mean?

The MySQL server has reached its maximum connection limit and is refusing new connections.

Common causes

  • 1The max_connections MySQL variable is set too low for the workload
  • 2Connection pooling is not configured and each application thread opens a new connection
  • 3Long-running queries hold connections open, exhausting the pool
  • 4ADF parallel copy activities each open separate connections without a shared pool

How to fix it

  1. 1Step 1: Check current connections: `SHOW STATUS LIKE 'Threads_connected';` and `SHOW VARIABLES LIKE 'max_connections';`
  2. 2Step 2: Increase the limit: `SET GLOBAL max_connections=500;` (also set in my.cnf for persistence).
  3. 3Step 3: Identify long-running connections: `SHOW PROCESSLIST;` — kill idle ones with `KILL <process_id>;`
  4. 4Step 4: Implement or tune connection pooling in the application to reuse connections.

Frequently asked questions

What is the default MySQL max_connections limit?

MySQL defaults to 151 connections. The actual usable limit is 150 — one is reserved for the SUPER privilege user for emergency access.

Can I set max_connections indefinitely high?

No — each connection consumes memory (roughly 1MB+ per connection). Set it based on available RAM: a common formula is available_RAM_MB divided by per-connection memory usage in MB.

How does MetricSign help when connection exhaustion hits multiple pipelines?

MetricSign groups simultaneous ADF failures into a single incident, showing which pipelines were affected, so you can see the blast radius of the connection limit issue.

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

Other connection errors