Get the App
SLTechnology News&Howtos  ›  Database  › 

Mysql session control limits the number of logins (connection_control plug-in)

Shulou Source: shulou.com Published: 2022-06-01 19:15:55 10月22日 Update

Database environment:

Server version: 5.6.41 MySQL Community Server (GPL)

1. View users

Mysql > select Host,User from user where User='jiangjj'

2. Install the plug-in

Installation method 1:

Mysql > Install plugin connection_control soname "connection_control.so"

Mysql > show plugins

Installation method 2:

# vim / etc/my.cnf

[mysqld]

# add the following parameters

Plugin-load=CONNECTION_CONTROL=connection_control.so

Connection_control_min_connection_delay=60000

Just restart it.

3. View the relevant configurations and make adjustments

The minimum delayed login time after 3 consecutive failures and exceeding the upper limit of failed connections is 1 minute.

Mysql > show variables like "connection_control%"

4. Test: if three login verifications fail, you will wait for 1 minute, as shown in the figure

5. Uninstall:

Mysql > uninstall plugin CONNECTION_CONTROL

6. Summary

The continuous failed login control takes effect, avoiding the possibility of a large number of illegal connections. In order to increase the safety factor, the minimum delay time can be increased.

Tags: Login minimum mode time delay plug-in times control security safety factor upper limit parameters possibility data database environment user coefficient secondary login as shown in the figure Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno OPPO Reno NVidia Linux Docker Xiaomi