@@ -40,55 +40,73 @@ var mysqlSysConfigs = map[string]string{
4040 "slave_parallel_type" : "LOGICAL_CLOCK" ,
4141 "relay_log" : "/var/lib/mysql/mysql-relay-bin" ,
4242 "relay_log_index" : "/var/lib/mysql/mysql-relay-bin.index" ,
43- "master_info_repository" : "TABLE" ,
44- "relay_log_info_repository" : "TABLE" ,
4543 "slow_query_log" : "1" ,
4644 "tmp_table_size" : "32M" ,
4745 "tmpdir" : "/var/lib/mysql" ,
4846}
4947
50- var specialConfigs = map [string ]string {
48+ var pluginConfigs = map [string ]string {
5149 "plugin-load" : "\" semisync_master.so;semisync_slave.so;audit_log.so;connection_control.so\" " ,
52- "audit_log_file" : "/var/log/mysql/mysql-audit.log" ,
53- "audit_log_exclude_accounts" : "\" root@localhost,root@127.0.0.1," + utils .ReplicationUser + "@%," + utils .MetricsUser + "@%\" " ,
54- "audit_log_buffer_size" : "16M" ,
50+
5551 "rpl_semi_sync_master_enabled" : "OFF" ,
5652 "rpl_semi_sync_slave_enabled" : "ON" ,
5753 "rpl_semi_sync_master_wait_no_slave" : "ON" ,
5854 "rpl_semi_sync_master_timeout" : "1000000000000000000" ,
59- //"audit-log": "ON",
55+
56+ "audit_log_file" : "/var/log/mysql/mysql-audit.log" ,
57+ "audit_log_exclude_accounts" : "\" root@localhost,root@127.0.0.1," + utils .ReplicationUser + "@%," + utils .MetricsUser + "@%\" " ,
58+ "audit_log_buffer_size" : "16M" ,
6059 "audit_log_policy" : "NONE" ,
6160 "audit_log_rotate_on_size" : "104857600" ,
6261 "audit_log_rotations" : "6" ,
6362 "audit_log_format" : "OLD" ,
63+
6464 "connection_control_failed_connections_threshold" : "3" ,
6565 "connection_control_min_connection_delay" : "1000" ,
6666 "connection_control_max_connection_delay" : "2147483647" ,
67- "default-authentication-plugin" : "mysql_native_password" ,
67+ }
68+
69+ var mysql57Configs = map [string ]string {
70+ "query-cache-type" : "0" ,
71+ "query-cache-size" : "0" ,
72+ "sql-mode" : "STRICT_TRANS_TABLES,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER," +
73+ "NO_AUTO_VALUE_ON_ZERO,NO_ENGINE_SUBSTITUTION,NO_ZERO_DATE,NO_ZERO_IN_DATE,ONLY_FULL_GROUP_BY" ,
74+
75+ "expire-logs-days" : "7" ,
76+
77+ "master_info_repository" : "TABLE" ,
78+ "relay_log_info_repository" : "TABLE" ,
79+ "slave_rows_search_algorithms" : "INDEX_SCAN,HASH_SCAN" ,
80+ }
81+
82+ var mysql80Configs = map [string ]string {
83+ "sql-mode" : "STRICT_TRANS_TABLES,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_VALUE_ON_ZERO,NO_ENGINE_SUBSTITUTION," +
84+ "NO_ZERO_DATE,NO_ZERO_IN_DATE,ONLY_FULL_GROUP_BY" ,
85+ // 7 days = 7 * 24 * 60 * 60
86+ "binlog_expire_logs_seconds" : "604800" ,
87+ // use 5.7 auth plugin to be backward compatible
88+ "default-authentication-plugin" : "mysql_native_password" ,
6889}
6990
7091// mysqlCommonConfigs is the map of the mysql common configs.
7192var mysqlCommonConfigs = map [string ]string {
7293 "character_set_server" : "utf8mb4" ,
7394 "interactive_timeout" : "3600" ,
7495 "default-time-zone" : "+08:00" ,
75- "expire_logs_days" : "7" ,
7696 "key_buffer_size" : "33554432" ,
7797 "log_bin_trust_function_creators" : "1" ,
7898 "long_query_time" : "3" ,
7999 "binlog_cache_size" : "32768" ,
80100 "binlog_stmt_cache_size" : "32768" ,
81101 "max_connections" : "1024" ,
82102 "max_connect_errors" : "655360" ,
83- "query_cache_size" : "0" ,
84103 "sync_master_info" : "1000" ,
85104 "sync_relay_log" : "1000" ,
86105 "sync_relay_log_info" : "1000" ,
87106 "table_open_cache" : "2000" ,
88107 "thread_cache_size" : "128" ,
89108 "wait_timeout" : "3600" ,
90109 "group_concat_max_len" : "1024" ,
91- "slave_rows_search_algorithms" : "INDEX_SCAN,HASH_SCAN" ,
92110 "max_allowed_packet" : "1073741824" ,
93111 "event_scheduler" : "OFF" ,
94112 "innodb_print_all_deadlocks" : "0" ,
@@ -102,12 +120,10 @@ var mysqlCommonConfigs = map[string]string{
102120// mysqlStaticConfigs is the map of the mysql static configs.
103121// The mysql need restart, if modify the config.
104122var mysqlStaticConfigs = map [string ]string {
105-
106123 "default-storage-engine" : "InnoDB" ,
107124 "back_log" : "2048" ,
108125 "ft_min_word_len" : "4" ,
109126 "lower_case_table_names" : "0" ,
110- "query_cache_type" : "OFF" ,
111127 "innodb_ft_max_token_size" : "84" ,
112128 "innodb_ft_min_token_size" : "3" ,
113129 "sql_mode" : "STRICT_TRANS_TABLES,NO_ENGINE_SUBSTITUTION" ,
0 commit comments