Avoid being blocked in case of the error :TOO MANY CONNECTIONS

July 2017



Issue


MySQL normally allows, by default, 100 (150 since version 5.1) connections to the server ...
Meaning that the 101st user will receive the error message "too many connections" ...

Solution


If this happens to you, for whatever reason (too many web site, the code loop, ...), then:

Just know that 101th Mysql connection gives higher privilege level.. So, by logging (for example) as root, you should be able to access the server:
  • examine what happens (SHOW FULL PROCESSLIST)
  • remove connections (KILL)
  • in the worst case stop the server (SHUTDOWN)

Notes


As stated above, the 101th connection is reserved for SUPER users ... meaning that if the user set in PHP, for example, has himself thits own privilege level, all this will not work ... so better not set up a website with a extended user feature ...

If this happens, however, it only remains for you to destroy the main process (kill -9), it is best to make a check tables then ...

Related


Published by jak58. Latest update on November 10, 2009 at 05:55 AM by jak58.
This document, titled "Avoid being blocked in case of the error :TOO MANY CONNECTIONS," is available under the Creative Commons license. Any copy, reuse, or modification of the content should be sufficiently credited to CCM (ccm.net).