最近更新时间:2023.10.31 15:06:06
首次发布时间:2023.03.15 17:15:36
本文介绍云数据库 MySQL 版为数据库版本 MySQL 8.0 提供的可修改参数,以及参数的默认值、修改后是否需要重启和取值范围。
序号 | 参数名 | 参数默认值 | 是否需要重启 | 取值范围 |
---|---|---|---|---|
1 | auto_increment_increment | 1 | 否 | [1-65535] |
2 | auto_increment_offset | 1 | 否 | [1-65535] |
3 | automatic_sp_privileges | ON | 否 | [ON|OFF] |
4 | avoid_temporal_upgrade | OFF | 否 | [ON|OFF] |
5 | back_log | 3000 | 是 | [0-65535] |
6 | binlog_cache_size | 2097152 | 否 | [4096-16777216] |
7 | binlog_checksum | CRC32 | 是 | [CRC32|NONE] |
8 | binlog_order_commits | ON | 否 | [ON|OFF] |
9 | binlog_row_image | full | 否 | [full|minimal] |
10 | binlog_rows_query_log_events | OFF | 否 | [ON|OFF] |
11 | binlog_stmt_cache_size | 32768 | 否 | [4096-16777216] |
12 | block_encryption_mode | aes-128-ecb | 否 | [aes-128-ecb|aes-192-ecb|aes-256-ecb|aes-128-cbc|aes-192-cbc|aes-256-cbc] |
13 | bulk_insert_buffer_size | 4194304 | 否 | [0-4294967295] |
14 | character_set_filesystem | binary | 否 | [utf8|latin1|gbk|binary] |
15 | character_set_server | utf8mb3 | 是 | [utf8mb3|latin1|gbk|gb18030\|utf8mb4] |
16 | collation_server | utf8_general_ci | 是 | [utf8mb4_0900_ai_ci|utf8mb4_0900_as_ci|utf8mb4_0900_as_cs|utf8mb4_bin|utf8mb4_croatian_ci|utf8mb4_cs_0900_ai_ci|utf8mb4_cs_0900_as_cs|utf8mb4_czech_ci|utf8mb4_danish_ci|utf8mb4_da_0900_ai_ci|utf8mb4_da_0900_as_cs|utf8mb4_de_pb_0900_ai_ci|utf8mb4_de_pb_0900_as_cs|utf8mb4_eo_0900_ai_ci|utf8mb4_eo_0900_as_cs|utf8mb4_esperanto_ci|utf8mb4_estonian_ci|utf8mb4_es_0900_ai_ci|utf8mb4_es_0900_as_cs|utf8mb4_es_trad_0900_ai_ci|utf8mb4_es_trad_0900_as_cs|utf8mb4_et_0900_ai_ci|utf8mb4_et_0900_as_cs|utf8mb4_general_ci|utf8mb4_german2_ci|utf8mb4_hr_0900_ai_ci|utf8mb4_hr_0900_as_cs|utf8mb4_hungarian_ci|utf8mb4_hu_0900_ai_ci|utf8mb4_hu_0900_as_cs|utf8mb4_icelandic_ci|utf8mb4_is_0900_ai_ci|utf8mb4_is_0900_as_cs|utf8mb4_ja_0900_as_cs\|utf8mb4_ja_0900_as_cs_ks|utf8mb4_latvian_ci|utf8mb4_la_0900_ai_ci|utf8mb4_la_0900_as_cs|utf8mb4_lithuanian_ci|utf8mb4_lt_0900_ai_ci|utf8mb4_lt_0900_as_cs|utf8mb4_lv_0900_ai_ci|utf8mb4_lv_0900_as_cs|utf8mb4_persian_ci|utf8mb4_pl_0900_ai_ci|utf8mb4_pl_0900_as_cs|utf8mb4_polish_ci|utf8mb4_romanian_ci|utf8mb4_roman_ci|utf8mb4_ro_0900_ai_ci|utf8mb4_ro_0900_as_cs|utf8mb4_ru_0900_ai_ci|utf8mb4_ru_0900_as_cs|utf8mb4_sinhala_ci|utf8mb4_sk_0900_ai_ci|utf8mb4_sk_0900_as_cs|utf8mb4_slovak_ci|utf8mb4_slovenian_ci|utf8mb4_sl_0900_ai_ci|utf8mb4_sl_0900_as_cs|utf8mb4_spanish2_ci|utf8mb4_spanish_ci|utf8mb4_sv_0900_ai_ci|utf8mb4_sv_0900_as_cs|utf8mb4_swedish_ci|utf8mb4_tr_0900_ai_ci|utf8mb4_tr_0900_as_cs|utf8mb4_turkish_ci|utf8mb4_unicode_520_ci|utf8mb4_unicode_ci|utf8mb4_vietnamese_ci|utf8mb4_vi_0900_ai_ci|utf8mb4_vi_0900_as_cs|utf8mb4_zh_0900_as_cs|utf8_general_ci|utf8_bin|utf8_unicode_ci|utf8_icelandic_ci|utf8_latvian_ci|utf8_romanian_ci|utf8_slovenian_ci|utf8_polish_ci|utf8_estonian_ci|utf8_spanish_ci|utf8_swedish_ci|utf8_turkish_ci|utf8_czech_ci|utf8_danish_ci|utf8_lithuanian_ci|utf8_slovak_ci|utf8_spanish2_ci|utf8_roman_ci|utf8_persian_ci|utf8_esperanto_ci|utf8_hungarian_ci|utf8_sinhala_ci|latin1_bin|latin1_danish_ci|latin1_general_ci|latin1_general_cs|latin1_german1_ci|latin1_german2_ci|latin1_spanish_ci|latin1_swedish_ci|gbk_bin|gbk_chinese_ci|gb18030_bin|gb18030_chinese_ci|gb18030_unicode_520_ci] |
17 | concurrent_insert | AUTO | 否 | [NEVER|AUTO|ALWAYS] |
18 | connect_timeout | 10 | 否 | [1-3600] |
19 | default_storage_engine | InnoDB | 是 | [InnoDB|innodb] |
20 | default_time_zone | +8:00 | 是 | [SYSTEM|-12:00|-11:00|-10:00|-9:00|-8:00|-7:00|-6:00|-5:00|-4:00|-3:00|-2:00|-1:00|+0:00|+1:00|+2:00|+3:00|+4:00|+5:00|+5:30|+5:45|+6:00|+6:30|+7:00|+8:00|+9:00|+10:00|+11:00|+12:00|+13:00] |
21 | default_week_format | 0 | 否 | [0-7] |
22 | delay_key_write | ON | 否 | [ON|OFF|ALL] |
23 | delayed_insert_limit | 100 | 否 | [1-4294967295] |
24 | delayed_insert_timeout | 300 | 否 | [1-3600] |
25 | delayed_queue_size | 1000 | 否 | [1-4294967295] |
26 | disconnect_on_expired_password | ON | 是 | [ON|OFF] |
27 | div_precision_increment | 4 | 否 | [0-30] |
28 | end_markers_in_json | OFF | 否 | [ON|OFF] |
29 | eq_range_index_dive_limit | 100 | 否 | [0-4294967295] |
30 | event_scheduler | OFF | 否 | [ON|OFF] |
31 | explicit_defaults_for_timestamp | OFF | 否 | [ON|OFF] |
32 | flush_time | 0 | 否 | [0-31536000] |
33 | ft_max_word_len | 84 | 是 | [10-84] |
34 | ft_min_word_len | 4 | 是 | [1-84] |
35 | ft_query_expansion_limit | 20 | 是 | [0-1000] |
36 | group_concat_max_len | 1024 | 否 | [4-1844674407370954752] |
37 | host_cache_size | 644 | 否 | [0-65535] |
38 | innodb_adaptive_flushing | ON | 否 | [ON|OFF] |
39 | innodb_adaptive_flushing_lwm | 10 | 否 | [0-70] |
40 | innodb_adaptive_hash_index | OFF | 否 | [ON|OFF] |
41 | innodb_adaptive_max_sleep_delay | 150000 | 否 | [1-1000000] |
42 | innodb_autoextend_increment | 64 | 否 | [1-1000] |
43 | innodb_autoinc_lock_mode | 2 | 是 | [0|1|2] |
44 | innodb_buffer_pool_dump_at_shutdown | ON | 否 | [ON|OFF] |
45 | innodb_buffer_pool_dump_pct | 25 | 否 | [1-100] |
46 | innodb_buffer_pool_instances | {LEAST(DBInstanceMemory/1073741824, 8)} | 是 | [1-64] |
47 | innodb_buffer_pool_load_at_startup | ON | 是 | [ON|OFF] |
48 | innodb_buffer_pool_size | {DBInstanceMemory*1/2} | 否 | [134217728-1099511627776] |
49 | innodb_change_buffer_max_size | 25 | 否 | [0-50] |
50 | innodb_change_buffering | all | 否 | [none|inserts|deletes|changes|purges|all] |
51 | innodb_checksum_algorithm | crc32 | 否 | [innodb|crc32|none|strict_innodb|strict_crc32|strict_none] |
52 | innodb_cmp_per_index_enabled | OFF | 否 | [ON|OFF] |
53 | innodb_commit_concurrency | 0 | 是 | [0-1000] |
54 | innodb_compression_failure_threshold_pct | 5 | 否 | [0-100] |
55 | innodb_compression_level | 6 | 否 | [0-9] |
56 | innodb_compression_pad_pct_max | 50 | 否 | [0-70] |
57 | innodb_concurrency_tickets | 5000 | 否 | [1-4294967295] |
58 | innodb_deadlock_detect | ON | 否 | [ON|OFF] |
59 | innodb_disable_sort_file_cache | ON | 否 | [ON|OFF] |
60 | innodb_flush_log_at_trx_commit | 1 | 否 | [0|1|2] 注意 该参数值从 1 修改为 2 时,日志文件每秒都会写入到磁盘,如果写入前系统崩溃,会导致最后 1 秒的日志丢失;如果修改为 0,会有数据丢失的风险,请谨慎操作。 |
61 | innodb_flush_method | O_DIRECT | 是 | [fsync|O_DSYNC|littlesync|nosync|O_DIRECT|O_DIRECT_NO_FSYNC] |
62 | innodb_flush_neighbors | 0 | 否 | [0|1|2] |
63 | innodb_flush_sync | ON | 否 | [ON|OFF] |
64 | innodb_ft_cache_size | 8000000 | 是 | [1600000-80000000] |
65 | innodb_ft_enable_diag_print | OFF | 否 | [ON|OFF] |
66 | innodb_ft_enable_stopword | ON | 否 | [ON|OFF] |
67 | innodb_ft_max_token_size | 84 | 是 | [10-84] |
68 | innodb_ft_min_token_size | 3 | 是 | [0-16] |
69 | innodb_ft_num_word_optimize | 2000 | 否 | [0-10000] |
70 | innodb_ft_result_cache_limit | 2000000000 | 否 | [1000000-4294967295] |
71 | innodb_ft_sort_pll_degree | 2 | 是 | [1-16] |
72 | innodb_ft_total_cache_size | 640000000 | 是 | [32000000-1600000000] |
73 | innodb_io_capacity | 5000 | 否 | [0-18446744073709551615] |
74 | innodb_io_capacity_max | 6000 | 否 | [0-18446744073709551615] |
75 | innodb_lock_wait_timeout | 50 | 否 | [1-1073741824] |
76 | innodb_log_checksums | ON | 否 | [ON|OFF] |
77 | innodb_log_compressed_pages | OFF | 否 | [ON|OFF] |
78 | innodb_lru_scan_depth | 1024 | 否 | [100-18446744073709551615] |
79 | innodb_max_dirty_pages_pct | 75 | 否 | [0-99] |
80 | innodb_max_dirty_pages_pct_lwm | 0 | 否 | [0-99] |
81 | innodb_max_purge_lag | 0 | 否 | [0-4294967295] |
82 | innodb_max_purge_lag_delay | 0 | 否 | [0-10000000] |
83 | innodb_max_undo_log_size | 1073741824 | 否 | [10485760-18446744073709551615] |
84 | innodb_old_blocks_pct | 37 | 否 | [5-95] |
85 | innodb_old_blocks_time | 1000 | 否 | [0-1024] |
86 | innodb_online_alter_log_max_size | 134217728 | 否 | [134217728-2147483647] |
87 | innodb_open_files | 3000 | 是 | [1-8192] |
88 | innodb_optimize_fulltext_only | OFF | 否 | [ON|OFF] |
89 | innodb_page_cleaners | {LEAST(DBInstanceMemory/1073741824, 8)} | 是 | [1-64] |
90 | innodb_print_all_deadlocks | ON | 否 | [ON|OFF] |
91 | innodb_purge_batch_size | 300 | 是 | [1-5000] |
92 | innodb_purge_rseg_truncate_frequency | 128 | 否 | [1-128] |
93 | innodb_purge_threads | 1 | 是 | [1-32] |
94 | innodb_random_read_ahead | OFF | 否 | [ON|OFF] |
95 | innodb_read_ahead_threshold | 56 | 否 | [0-1024] |
96 | innodb_read_io_threads | 4 | 是 | [1-64] |
97 | innodb_rollback_on_timeout | OFF | 是 | [ON|OFF] |
98 | innodb_rollback_segments | 128 | 否 | [1-128] |
99 | innodb_sort_buffer_size | 1048576 | 是 | [65536-67108864] |
100 | innodb_spin_wait_delay | 6 | 否 | [0-4294967295] |
101 | innodb_stats_auto_recalc | ON | 否 | [ON|OFF] |
102 | innodb_stats_method | nulls_equal | 否 | [nulls_equal|nulls_unequal|nulls_ignored] |
103 | innodb_stats_on_metadata | OFF | 否 | [ON|OFF] |
104 | innodb_stats_persistent | ON | 否 | [ON|OFF] |
105 | innodb_stats_persistent_sample_pages | 20 | 否 | [0-4294967295] |
106 | innodb_stats_transient_sample_pages | 8 | 否 | [1-4294967295] |
107 | innodb_status_output | OFF | 否 | [ON|OFF] |
108 | innodb_status_output_locks | OFF | 否 | [ON|OFF] |
109 | innodb_strict_mode | OFF | 否 | [ON|OFF] |
110 | innodb_sync_array_size | 1 | 是 | [1-1024] |
111 | innodb_sync_spin_loops | 30 | 否 | [0-4294967295] |
112 | innodb_table_locks | ON | 否 | [ON|OFF] |
113 | innodb_thread_concurrency | 0 | 否 | [0-1000] |
114 | innodb_thread_sleep_delay | 10000 | 否 | [0-1000000] |
115 | innodb_write_io_threads | 4 | 是 | [1-64] |
116 | interactive_timeout | 7200 | 否 | [10-86400] |
117 | join_buffer_size | {LEAST(DBInstanceMemory/1048576*128, 262144)} | 否 | [128-4294967295] |
118 | key_cache_age_threshold | 300 | 否 | [100-4294967295] |
119 | key_cache_block_size | 1024 | 否 | [512-16384] |
120 | key_cache_division_limit | 100 | 否 | [1-100] |
121 | lc_time_names | en_US | 否 | [ja_JP|pt_BR|en_US] |
122 | local_infile | ON | 否 | [ON|OFF] |
123 | lock_wait_timeout | 31536000 | 否 | [1-31536000] |
124 | log_error_verbosity | 2 | 否 | [1-3] |
125 | log_queries_not_using_indexes | OFF | 否 | [ON|OFF] |
126 | log_slow_admin_statements | OFF | 否 | [ON|OFF] |
127 | log_throttle_queries_not_using_indexes | 0 | 否 | [0-4294967295] |
128 | long_query_time | 1 | 否 | [0.1-31536000] |
129 | low_priority_updates | OFF | 否 | [ON|OFF] |
130 | max_allowed_packet | 1073741824 | 否 | [16384-1073741824] |
131 | max_binlog_cache_size | 18400000000000000000 | 否 | [4096-18446744073709547520] |
132 | max_binlog_stmt_cache_size | 18400000000000000000 | 否 | [4096-18446744073709547520] |
133 | max_connect_errors | 100 | 否 | [0-4294967295] |
134 | max_error_count | 64 | 否 | [0-65535] |
135 | max_execution_time | 0 | 否 | [0-4294967295] |
136 | max_heap_table_size | 67108864 | 否 | [16384-1844674407370954752] |
137 | max_join_size | 18446744073709551615 | 否 | [1-18446744073709551615] |
138 | max_length_for_sort_data | 1024 | 否 | [4-8388608] |
139 | max_points_in_geometry | 65536 | 否 | [3-1048576] |
140 | max_prepared_stmt_count | 16382 | 否 | [0-1048576] |
141 | max_seeks_for_key | 18400000000000000000 | 否 | [1-18446744073709551615] |
142 | max_sort_length | 1024 | 否 | [4-8388608] |
143 | max_sp_recursion_depth | 0 | 否 | [0-255] |
144 | max_write_lock_count | 102400 | 否 | [1-102400] |
145 | min_examined_row_limit | 0 | 否 | [0-4294967295] |
146 | myisam_sort_buffer_size | 262144 | 否 | [262144-16777216] |
147 | mysql_native_password_proxy_users | OFF | 否 | [ON|OFF] |
148 | net_buffer_length | 16384 | 否 | [1024-1048576] |
149 | net_read_timeout | 30 | 否 | [1-31536000] |
150 | net_retry_count | 10 | 否 | [1-4294967295] |
151 | net_write_timeout | 60 | 否 | [1-31536000] |
152 | ngram_token_size | 2 | 是 | [1-10] |
153 | open_files_limit | 1048576 | 是 | [1-18446744073709551615] |
154 | optimizer_prune_level | 1 | 否 | [0|1] |
155 | optimizer_search_depth | 62 | 否 | [0-62] |
156 | optimizer_trace_limit | 1 | 否 | [0-4294967295] |
157 | optimizer_trace_max_mem_size | 16384 | 否 | [0-4294967295] |
158 | optimizer_trace_offset | -1 | 否 | [-2147483648-2147483647] |
159 | preload_buffer_size | 32768 | 否 | [1024-1073741824] |
160 | query_alloc_block_size | 8192 | 否 | [1024-16384] |
161 | query_prealloc_size | 8192 | 否 | [8192-1048576] |
162 | range_alloc_block_size | 4096 | 否 | [4096-18446744073709551615] |
163 | range_optimizer_max_mem_size | 8388608 | 是 | [0-18446744073709551615] |
164 | read_buffer_size | {LEAST(DBInstanceMemory/1048576*128, 262144)} | 否 | [8200-2147479552] |
165 | relay_log_recovery | ON | 是 | [ON|OFF] |
166 | session_track_gtids | OFF | 否 | [OFF|OWN_GTID|ALL_GTIDS] |
167 | sha256_password_proxy_users | OFF | 否 | [ON|OFF] |
168 | show_old_temporals | OFF | 否 | [ON|OFF] |
169 | slow_launch_time | 2 | 否 | [1-1024] |
170 | slow_query_log | ON | 否 | [ON|OFF] |
171 | sort_buffer_size | 262144 | 否 | [32768-4294967295] |
172 | sql_mode | ONLY_FULL_GROUP_BY,STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_ENGINE_SUBSTITUTION | 否 | [*ALLOW_INVALID_DATES|ANSI_QUOTES|ERROR_FOR_DIVISION_BY_ZERO|HIGH_NOT_PRECEDENCE|IGNORE_SPACE|NO_AUTO_VALUE_ON_ZERO|NO_BACKSLASH_ESCAPES|NO_DIR_IN_CREATE|NO_ENGINE_SUBSTITUTION|NO_UNSIGNED_SUBTRACTION|NO_ZERO_DATE|NO_ZERO_IN_DATE|ONLY_FULL_GROUP_BY|PAD_CHAR_TO_FULL_LENGTH|PIPES_AS_CONCAT|REAL_AS_FLOAT|STRICT_ALL_TABLES|STRICT_TRANS_TABLES|TIME_TRUNCATE_FRACTIONAL] |
173 | sql_safe_updates | OFF | 否 | [ON|OFF] |
174 | stored_program_cache | 256 | 否 | [16-524288] |
175 | sync_binlog | 1 | 否 | [0-4294967295] 注意 该参数值从 1 修改到其他值时,会有数据丢失的风险,请谨慎操作。 |
176 | table_definition_cache | {LEAST(DBInstanceMemory/1073741824*512, 2048)} | 否 | [400-524288] |
177 | table_open_cache | {LEAST(DBInstanceMemory/1073741824*256, 2048)} | 否 | [1-524288] |
178 | table_open_cache_instances | {LEAST(DBInstanceMemory/1073741824, 16)} | 是 | [1-64] |
179 | thread_cache_size | 100 | 否 | [0-16384] |
180 | thread_stack | 262144 | 是 | [131072-2147483647] |
181 | tls_version | TLSv1,TLSv1.1,TLSv1.2 | 是 | [TLSv1,TLSv1.1,TLSv1.2|TLSv1,TLSv1.1|TLSv1.2] |
182 | tmp_table_size | 2097152 | 否 | [262144-134217728] |
183 | transaction_alloc_block_size | 8192 | 否 | [1024-131072] |
184 | transaction_isolation | READ-COMMITTED | 否 | [READ-UNCOMMITTED|READ-COMMITTED|REPEATABLE-READ|SERIALIZABLE] |
185 | transaction_prealloc_size | 4096 | 否 | [1024-131072] |
186 | updatable_views_with_limit | YES | 否 | [YES|NO] |
187 | wait_timeout | 86400 | 否 | [1-31536000] |
188 | max_connections | 不同规格默认值不同。 | 否 | [100-100000] |
189 | max_user_connections | 0 | 否 | [0|100-100000] |
190 | loose_thread_pool_enabled | OFF | 是 | [ON|OFF] |
191 | loose_thread_pool_oversubscribe | 16 | 否 | [2-128] |
192 | loose_thread_pool_size | 2 | 否 | [1-64] |
193 | loose_kill_idle_transaction | 0 | 否 | [0-31536000] |
194 | loose_rds_performance_schema | OFF | 是 | [ON|OFF] |
可登录数据库工作台,使用 SQL 语句 SHOW variables like '参数名'
查看。