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 https://dev.mysql.com/doc/refman/8.0/en/connection-interfaces.html 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 https://dev.mysql.com/doc/refman/8.0/en/server-system-variables.html#sysvar_init_connect 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


Subject
Views
Written By
Posted
2034
September 25, 2020 10:10AM
612
September 25, 2020 11:57AM
Re: Disable All Logins
562
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.