Bug #5309 MySQL should reserve a connection for the admin (root) user
Submitted: 31 Aug 2004 0:11 Modified: 3 Feb 2006 13:21
Reporter: Christian Hammers (Silver Quality Contributor) (OCA) Email Updates:
Status: Verified Impact on me:
Category:MySQL Server: General Severity:S4 (Feature request)
Version:4.0.20 OS:Linux (Debian GNU/Linux)
Assigned to: CPU Architecture:Any
Tags: qc

[31 Aug 2004 0:11] Christian Hammers
Debian bug report http://bugs.debian.org/269114 by Mark Ferlatte:
> When MySQL runs out of threads (due to OS thread limits, ulimit, or
> connection limits), the root MySQL user can no longer connect.  This makes
> it difficult to impossible to debug or repair the ailing MySQL server. 
> MySQL should reserve a thread for connections by the MySQL `root' user.

Note that we are aware that there is already a thread reserverd in case the max_connection limit is set but this does not work in case of a hit ulimit.



How to repeat:
Set "ulimit -u 5" in /etc/init.d/mysql and start some instances. Soon you'll get a:

$ mysql -u root
ERROR 1135: Can't create a new thread (errno 11). If you are not out of available memory, you can consult the manual for a possible OS-dependent bug

-> it's impossible to look at the processlist nor to shutdown the server cleanly

Suggested fix:
Start a maintenance thread as first thread which allowes only root connections.
[3 Feb 2006 13:21] Valeriy Kravchuk
Thank you for a reasonable feature request.
[2 Sep 2009 16:40] Valeriy Kravchuk
Bug #47060 looks closely related. We need a reliable way to let SUPER user connect in any case.
[25 Sep 2018 6:59] Daniƫl van Eeden
Bug #5309 	MySQL should reserve a connection for the admin (root) user