MySQL Forums
Forum List  »  Security

Re: Disable All Logins
Posted by: Georgi Kodinov
Date: October 29, 2020 02:12AM

Several tricks can be employed to the effect. See for some ideas.
One way would be to set max_connections to 1.
This will allow 1 "regular" connection and 1 connection for users with CONNECTION_ADMIN or SUPER.
max_connections is dynamic so you can do a SET GLOBAL for it.
Once you get into that state you can then safely kill all sessions and go on.

Another trick is to set a command that throws a SQL error.
This will cause all future connections to fail at connect. It's also dynamic so you can do a SET GLOBAL.

Georgi "Joro" Kodinov
MySQL SrvGen team lead
Plovdiv, Bulgaria

Options: ReplyQuote

Written By
September 25, 2020 10:10AM
September 25, 2020 11:57AM
Re: Disable All Logins
October 29, 2020 02:12AM

Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.