Error code

MySQL 1040

MYSQL1040
Database Error Code· An error code returned by a database server such as PostgreSQL or MySQL.

What it means

Too many connections — the server has reached its connection limit.

How to fix it

  1. Add a connection pool (e.g. ProxySQL or application-level pooling) to multiplex connections.
  2. Increase max_connections in my.cnf and restart MySQL.

Not affiliated with MySQL. Answer summarized from the manufacturer's manual linked above; consult that source for the authoritative procedure.