↑ ↓ select, Enter open, Esc close

Compare max connections with the peak so far

root@server
mysql -e "SHOW GLOBAL STATUS LIKE 'Max_used_connections'; SHOW GLOBAL VARIABLES LIKE 'max_connections';"

Prints the maximum allowed number of simultaneous connections and the peak value since the last start. If the peak is at the limit, visitors see the error “Too many connections”. Then either raise the limit or look for the cause of the many open connections.

Note: Individual settings can generally be queried with SHOW GLOBAL VARIABLES LIKE 'name';.

Also searched as

  • too many connections mysql
  • max_connections reached
  • mysql not enough connections

Related one-liners

All in MySQL and MariaDB

Read first, then run.

The commands on myline.de act directly on servers, files and databases. A wrong path or placeholder can delete data irreversibly or make a server unreachable.

  • All commands are provided without warranty and are not tested on every system.
  • Understand what a command does before running it, and check every placeholder.
  • Make a backup first and, if possible, try it on a test system.
  • You run commands at your own risk. Liability for damages is excluded to the extent permitted by law.