时间:2020-05-21来源:电脑系统城作者:电脑系统城
mysql> select version() from dual;
+-----------+
| version() |
+-----------+
| 8.0.18 |
+-----------+
1 row in set (0.00 sec)
mysql> show variables like 'plugin_dir';
+---------------+--------------------------+
| Variable_name | Value |
+---------------+--------------------------+
| plugin_dir | /usr/lib64/mysql/plugin/ |
+---------------+--------------------------+
1 row in set (0.01 sec)
[root@KerryDB ~]# cd /usr/lib64/mysql/plugin/
[root@KerryDB plugin]# ls -lrt
total 76388
-rwxr-xr-x. 1 root root 106696 Sep 20 2019 rewrite_example.so
-rwxr-xr-x. 1 root root 104432 Sep 20 2019 mysql_no_login.so
-rwxr-xr-x. 1 root root 111464 Sep 20 2019 mypluglib.so
-rwxr-xr-x. 1 root root 106648 Sep 20 2019 auth_socket.so
-rwxr-xr-x. 1 root root 163560 Sep 20 2019 adt_null.so
-rwxr-xr-x. 1 root root 409032 Sep 20 2019 validate_password.so
-rwxr-xr-x. 1 root root 9054776 Sep 20 2019 libpluginmecab.so
-rwxr-xr-x. 1 root root 344696 Sep 20 2019 authentication_ldap_sasl_client.so
-rwxr-xr-x. 1 root root 1145832 Sep 20 2019 rewriter.so
-rwxr-xr-x. 1 root root 625944 Sep 20 2019 ha_example.so
-rwxr-xr-x. 1 root root 388992 Sep 20 2019 semisync_slave.so
-rwxr-xr-x. 1 root root 32368 Sep 20 2019 component_log_sink_json.so
-rwxr-xr-x. 1 root root 235200 Sep 20 2019 component_audit_api_message_emit.so
-rwxr-xr-x. 1 root root 494720 Sep 20 2019 keyring_udf.so
-rwxr-xr-x. 1 root root 149280 Sep 20 2019 component_log_sink_syseventlog.so
-rwxr-xr-x. 1 root root 1446024 Sep 20 2019 semisync_master.so
-rwxr-xr-x. 1 root root 2277480 Sep 20 2019 mysql_clone.so
-rwxr-xr-x. 1 root root 1231376 Sep 20 2019 libmemcached.so
-rwxr-xr-x. 1 root root 454096 Sep 20 2019 component_mysqlbackup.so
-rwxr-xr-x. 1 root root 193336 Sep 20 2019 component_log_filter_dragnet.so
-rwxr-xr-x. 1 root root 1177352 Sep 20 2019 ha_mock.so
-rwxr-xr-x. 1 root root 83936 Sep 20 2019 locking_service.so
-rwxr-xr-x. 1 root root 1269784 Sep 20 2019 connection_control.so
-rwxr-xr-x. 1 root root 1280936 Sep 20 2019 innodb_engine.so
-rwxr-xr-x. 1 root root 442304 Sep 20 2019 component_validate_password.so
-rwxr-xr-x. 1 root root 1206024 Sep 20 2019 version_token.so
-rwxr-xr-x. 1 root root 2338880 Sep 20 2019 keyring_file.so
-rwxr-xr-x. 1 root root 2031912 Sep 20 2019 ddl_rewriter.so
-rwxr-xr-x. 1 root root 49246400 Sep 20 2019 group_replication.so
drwxr-xr-x. 2 root root 4096 Nov 6 2019 debug
mysql> INSTALL PLUGIN CONNECTION_CONTROL SONAME 'connection_control.so';
Query OK, 0 rows affected (0.02 sec)
mysql> INSTALL PLUGIN CONNECTION_CONTROL_FAILED_LOGIN_ATTEMPTS SONAME 'connection_control.so';
Query OK, 0 rows affected (0.00 sec)
mysql> show plugins;
mysql> SELECT PLUGIN_NAME, PLUGIN_LIBRARY, PLUGIN_STATUS, LOAD_OPTION
-> FROM INFORMATION_SCHEMA.PLUGINS
-> WHERE PLUGIN_LIBRARY = 'CONNECTION_CONTROL.SO';
+------------------------------------------+-----------------------+---------------+-------------+
| PLUGIN_NAME | PLUGIN_LIBRARY | PLUGIN_STATUS | LOAD_OPTION |
+------------------------------------------+-----------------------+---------------+-------------+
| CONNECTION_CONTROL | connection_control.so | ACTIVE | FORCE |
| CONNECTION_CONTROL_FAILED_LOGIN_ATTEMPTS | connection_control.so | ACTIVE | FORCE |
+------------------------------------------+-----------------------+---------------+-------------+
2 rows in set (0.00 sec)
mysql>
mysql> show variables like 'connection_control%';
+-------------------------------------------------+------------+
| Variable_name | Value |
+-------------------------------------------------+------------+
| connection_control_failed_connections_threshold | 3 |
| connection_control_max_connection_delay | 2147483647 |
| connection_control_min_connection_delay | 1000 |
+-------------------------------------------------+------------+
-- 配置文件增加以下配置
[mysqld]
plugin-load-add = connection_control.so #不是必须
connection-control = FORCE #不是必须
connection-control-failed-login-attempts = FORCE #不是必须
connection_control_min_connection_delay = 60000
connection_control_max_connection_delay = 1800000
connection_control_failed_connections_threshold = 3
[root@lnx02 ~]# mysql -h 10.20.57.24 -u test -p
Enter password:
ERROR 1045 (28000): Access denied for user 'test'@'192.168.27.180' (using password: YES)
[root@lnx02 ~]# mysql -h 10.20.57.24 -u test -p
Enter password:
ERROR 1045 (28000): Access denied for user 'test'@'192.168.27.180' (using password: YES)
[root@lnx02 ~]# mysql -h 10.20.57.24 -u test -p
Enter password:
ERROR 1045 (28000): Access denied for user 'test'@'192.168.27.180' (using password: YES)
[root@lnx02 ~]# mysql -h 10.20.57.24 -u test -p
Enter password:
mysql> SELECT * FROM
-> INFORMATION_SCHEMA.CONNECTION_CONTROL_FAILED_LOGIN_ATTEMPTS;
+-------------------+-----------------+
| USERHOST | FAILED_ATTEMPTS |
+-------------------+-----------------+
| 'test'@'192.168%' | 5 |
+-------------------+-----------------+
1 row in set (0.00 sec)
mysql>
mysql> set global connection_control_failed_connections_threshold=2;
Query OK, 0 rows affected (0.00 sec)
mysql> SELECT * FROM
-> INFORMATION_SCHEMA.CONNECTION_CONTROL_FAILED_LOGIN_ATTEMPTS;
Empty set (0.00 sec)
2023-10-30
windows上的mysql服务突然消失提示10061 Unkonwn error问题及解决方案2023-10-30
MySQL非常重要的日志bin log详解2023-10-30
详解MySQL事务日志redo log一、单表查询 1、排序 2、聚合函数 3、分组 4、limit 二、SQL约束 1、主键约束 2、非空约束 3、唯一约束 4、外键约束 5、默认值 三、多表查询 1、内连接 1)隐式内连接: 2)显式内连接: 2、外连接 1)左外连接 2)右外连接 四...
2023-10-30
Mysql删除表重复数据 表里存在唯一主键 没有主键时删除重复数据 Mysql删除表中重复数据并保留一条 准备一张表 用的是mysql8 大家自行更改 创建表并添加四条相同的数据...
2023-10-30