8.4 中文镜像

MySQL 8.4 参考手册 · 中文镜像

正文为中文,英文原文默认隐藏。点击任意中文段落即可展开 / 收起对应英文原文。

打开官方英文原文 ↗

译文由机器翻译生成,仅供理解参考;有疑问请以官方英文原文为准。

MySQL 8.4 参考手册 / 3 升级 MySQL / 3.5 MySQL 8.4 的变化
中文点击中文段落可显示 / 隐藏英文原文本页译文覆盖 88%

3.5 MySQL 8.4 的变化3.5 Changes in MySQL 8.4

在升级到 MySQL 8.4 之前,请查看下列各部分中描述的更改,以确定哪些适用于您当前的 MySQL 安装和应用程序。Before upgrading to MySQL 8.4, review the changes described in the following sections to identify those that apply to your current MySQL installation and applications.

此外,您可以查阅此处列出的资源:In addition, you can consult the resources listed here:

MySQL 8.4 中的不兼容更改Incompatible Changes in MySQL 8.4

本节包含有关 MySQL 8.4 不兼容更改的信息。This section contains information about incompatible changes in MySQL 8.4.

有关 MySQL 8.4 中更改的详细信息,请参见 第 1.4 节,“自 MySQL 8.0 以来 MySQL 8.4 的新内容”。For additional information about changes in MySQL 8.4, see Section 1.4, “What Is New in MySQL 8.4 since MySQL 8.0”.

更改的服务器默认值Changed Server Defaults

本节包含有关 MySQL 服务器系统变量的信息,这些变量在 MySQL 8.4 中的默认值与 MySQL 8.0 相比已经更改。This section contains information about MySQL server system variables whose default values have changed in MySQL 8.4 as compared to MySQL 8.0.

系统变量System Variable 旧默认值Old Default 新默认值New Default
InnoDB 变更InnoDB changes
innodb_adaptive_hash_indexinnodb_adaptive_hash_index ONON OFFOFF
innodb_buffer_pool_in_core_fileinnodb_buffer_pool_in_core_file ONON OFFOFF
innodb_buffer_pool_instancesinnodb_buffer_pool_instances innodb_buffer_pool_size < 1GB: 1; 否则: 8innodb_buffer_pool_size < 1GB: 1; otherwise: 8 innodb_buffer_pool_size <= 1GB: 1; 否则: MIN( 0.5 * (innodb_buffer_pool_size / innodb_buffer_pool_chunk_size), 0.25 * number_of_cpus)innodb_buffer_pool_size <= 1GB: 1; otherwise: MIN( 0.5 * (innodb_buffer_pool_size / innodb_buffer_pool_chunk_size), 0.25 * number_of_cpus)
innodb_change_bufferinginnodb_change_buffering allall nonenone
innodb_doublewrite_filesinnodb_doublewrite_files innodb_buffer_pool_instances * 2 2
innodb_doublewrite_pagesinnodb_doublewrite_pages innodb_write_io_threads 的值Value of innodb_write_io_threads 128
innodb_flush_method fsync O_DIRECT(如果支持),否则 fsyncO_DIRECT if supported, otherwise fsync
innodb_io_capacityinnodb_io_capacity 200 10000
innodb_io_capacity_maxinnodb_io_capacity_max MIN(2 * innodb_io_capacity, 2000) 2 * innodb_io_capacity
innodb_log_buffer_sizeinnodb_log_buffer_size 16777216 67108864
innodb_numa_interleaveinnodb_numa_interleave OFFOFF ONON
innodb_page_cleanersinnodb_page_cleaners 4 innodb_buffer_pool_instances 的值Value of innodb_buffer_pool_instances
innodb_parallel_read_threadsinnodb_parallel_read_threads 4 MIN(number_of_cpus / 8, 4)
innodb_purge_threadsinnodb_purge_threads 4 如果 number_of_cpus <= 16: 1;否则: 4If number_of_cpus <= 16: 1; otherwise: 4
innodb_use_fdatasyncinnodb_use_fdatasync OFFOFF ONON
组复制更改Group Replication changes
group_replication_consistency EVENTUALEVENTUAL BEFORE_ON_PRIMARY_FAILOVERBEFORE_ON_PRIMARY_FAILOVER
group_replication_exit_state_action READ_ONLYREAD_ONLY OFFLINE_MODEOFFLINE_MODE
临时表更改Temporary table changes
temptable_max_mmaptemptable_max_mmap 1073741824 0
temptable_max_ramtemptable_max_ram 1073741824 总内存的 3%,范围在 1-4(GB)之间3% of total memory within a range of 1-4 (GB)
temptable_use_mmap ONON OFFOFF

有关已添加的选项或变量的更多信息,请参见 MySQL 8.4 的选项和变量更改,在 MySQL 服务器版本参考 中。For more information about options or variables which have been added, see Option and Variable Changes for MySQL 8.4, in the MySQL Server Version Reference.

虽然新的默认设置对于大多数使用场景来说是最佳配置选择,但仍有特殊情况,以及出于兼容旧系统的原因可能需要使用现有的配置选择。例如,有些人希望尽可能少地对他们的应用程序或操作环境进行更改就升级到 MySQL 8.4。我们建议评估所有新的默认设置,并尽可能多地使用它们。Although the new defaults are the best configuration choices for most use cases, there are special cases, as well as legacy reasons for using existing configuration choices. For example, some people prefer to upgrade to MySQL 8.4 with as few changes to their applications or operational environment as possible. We recommend to evaluate all the new defaults and use as many as you can.

性能模式 variables_info 表显示了每个系统变量最近一次设置的来源,以及其取值范围。这提供了对系统变量及其值的所有信息的 SQL 访问。The Performance Schema variables_info table shows, for each system variable, the source from which it was most recently set, as well as its range of values. This provides SQL access to all there is to know about a system variable and its values.