导航

mysql> show variables like 'plugin_dir';
+---------------+------------------------------+
| Variable_name | Value |
+---------------+------------------------------+
| plugin_dir | /usr/local/mysql/lib/plugin/ |
+---------------+------------------------------+
1 row in set (0.00 sec)

mysql> Install plugin connection_control soname "connection_control.so";
Query OK, 0 rows affected (0.00 sec)

mysql> INSTALL PLUGIN CONNECTION_CONTROL_FAILED_LOGIN_ATTEMPTS SONAME 'connection_control.so';
Query OK, 0 rows affected (0.00 sec)

mysql> select plugin_name, plugin_library, load_option from information_schema.plugins where plugin_library = 'connection_control.so';
+------------------------------------------+-----------------------+-------------+
| plugin_name | plugin_library | load_option |
+------------------------------------------+-----------------------+-------------+
| CONNECTION_CONTROL | connection_control.so | ON |
| CONNECTION_CONTROL_FAILED_LOGIN_ATTEMPTS | connection_control.so | ON |
+------------------------------------------+-----------------------+-------------+

检查方法:

1、执行SQL语句:

select plugin_name,plugin_library,load_option from information_schema.plugins where plugin_name = 'connection_control';

预期结果:

输出结果不为空,检查是否加载了connection_control插件,且load_option为Force。

2、执行SQL语句:

select plugin_name,plugin_library,load_option from information_schema.plugins where plugin_name = 'connection_control_failed_login_attempts';

预期结果:

输出结果不为空,检查是否加载了connection_control_failed_login_attempts插件,且load_option为Force。

3、执行SQL语句:

show variables where variable_name = 'connection_control_failed_connections_threshold';

预期结果:

输出结果应该不为空,表明登录失败开始延时的阈值为非空。

4、执行SQL语句:

show variables where variable_name = 'connection_control_min_connection_delay';

预期结果:

输出结果应该不为空,表明每次登录失败后登录延时增加的毫秒数非空。

5、执行SQL语句:

show variables where variable_name = 'connection_control_max_connection_delay';

预期结果:

输出结果应该不为空,表明失败后登录延时增加最大毫秒数非空。