8.4 中文镜像

MySQL 8.4 参考手册 · 中文镜像

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

打开官方英文原文 ↗

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

MySQL 8.4 参考手册 / 1 一般信息 / 1.4 自 MySQL 8.0 以来 MySQL 8.4 的新增内容
中文点击中文段落可显示 / 隐藏英文原文本页译文覆盖 100%

1.4 自 MySQL 8.0 以来 MySQL 8.4 中的新增内容1.4 What Is New in MySQL 8.4 since MySQL 8.0

本节总结了自 MySQL 以来 MySQL 8.4 中添加、弃用、更改和删除的内容 8.0。配套部分列出了 MySQL 8.4 中添加、弃用或删除的 MySQL 服务器选项和变量;请参阅第 1.5 节,“自 8.0 起,MySQL 8.4 中添加、弃用或删除的服务器和状态变量及选项”。This section summarizes what has been added to, deprecated in, changed, and removed from MySQL 8.4 since MySQL 8.0. A companion section lists MySQL server options and variables that have been added, deprecated, or removed in MySQL 8.4; see Section 1.5, “Server and Status Variables and Options Added, Deprecated, or Removed in MySQL 8.4 since 8.0”.

MySQL 8.4 中添加或更改的功能Features Added or Changed in MySQL 8.4

MySQL 8.4 中添加了以下功能:The following features have been added to MySQL 8.4:

  • MySQL 本机密码身份验证更改。 从 MySQL 8.4.0 开始,默认情况下不再启用已弃用的 mysql_native_password 身份验证插件。要启用它,请使用 --mysql-native-password=ON (在 MySQL 8.4.0 中添加)启动服务器,或者在 MySQL 配置文件的 [mysqld] 部分中包含 mysql_native_password=ON (已添加)在 MySQL 8.4.0 中)。MySQL native password authentication changes.  Beginning with MySQL 8.4.0, the deprecated mysql_native_password authentication plugin is no longer enabled by default. To enable it, start the server with --mysql-native-password=ON (added in MySQL 8.4.0), or by including mysql_native_password=ON in the [mysqld] section of your MySQL configuration file (added in MySQL 8.4.0).

    有关启用、使用和禁用 mysql_native_password 的更多信息,请参阅第 8.4.1.1 节“本机可插入身份验证”身份验证”。For more information about enabling, using, and disabling mysql_native_password, see Section 8.4.1.1, “Native Pluggable Authentication”.

  • InnoDB 系统变量默认值更改。 MySQL 8.4.0 中更改了一些与 InnoDB 存储引擎相关的服务器系统变量的默认值,如下表所示:InnoDB system variable default value changes.  The default values for a number of server system variables relating to the InnoDB storage engine were changed in MySQL 8.4.0, as shown in the following table:

    表 1.1 MySQL 8.4 中的 InnoDB 系统变量默认值不同来自 MySQL 8.0Table 1.1 InnoDB system variable default values in MySQL 8.4 differing from MySQL 8.0

    InnoDB 系统变量名称InnoDB System Variable Name 新默认值 (MySQL 8.4)New Default Value (MySQL 8.4) 以前的默认值 (MySQL 8.0)Previous Default Value (MySQL 8.0)
    innodb_buffer_pool_in_core_fileinnodb_buffer_pool_in_core_file OFF 如果支持 MADV_DONTDUMP,否则ONOFF if MADV_DONTDUMP is supported, otherwise ON ONON
    innodb_buffer_pool_instancesinnodb_buffer_pool_instances

    如果innodb_buffer_pool_size <= 1 GiB,则 innodb_buffer_pool_instances=1If innodb_buffer_pool_size <= 1 GiB, then innodb_buffer_pool_instances=1

    如果 innodb_buffer_pool_size > 1 GiB,那么这是以下两个计算提示的最小值,范围为 1-64:If innodb_buffer_pool_size > 1 GiB, then this is the minimum value from the following two calculated hints in the range of 1-64:

    8(或 1) if innodb_buffer_pool_size < 1 GiB)8 (or 1 if innodb_buffer_pool_size < 1 GiB)
    innodb_change_bufferinginnodb_change_buffering nonenone allall
    --innodb-dedicated-server--innodb-dedicated-server 如果ON,则 innodb_flush_method不再像 MySQL 8.0 中那样改变,但是innodb_redo_log_capacity的计算从基于内存变为基于 CPU。有关详细信息,请参阅第 17.8.12 节 “为专用 MySQL 服务器启用自动 InnoDB 配置”。 (此变量的实际默认值为 OFF;这在 MySQL 8.0 中没有变化。)If ON, the value of innodb_flush_method is no longer changed as in MySQL 8.0, but the calculation of innodb_redo_log_capacity is changed from memory-based to CPU-based. For more information, see Section 17.8.12, “Enabling Automatic InnoDB Configuration for a Dedicated MySQL Server”. (The actual default value of this variable is OFF; this is unchanged from MySQL 8.0.) OFFOFF
    innodb_adaptive_hash_indexinnodb_adaptive_hash_index OFFOFF ONON
    innodb_doublewrite_filesinnodb_doublewrite_files 2 innodb_buffer_pool_instances * 2innodb_buffer_pool_instances * 2
    innodb_doublewrite_pagesinnodb_doublewrite_pages 128 innodb_write_io_threads,这意味着默认值为 4innodb_write_io_threads, which meant a default of 4
    innodb_flush_method(Linux 上)innodb_flush_method on Linux O_DIRECT(如果支持),否则 fsyncO_DIRECT if supported, otherwise fsync fsyncfsync
    innodb_io_capacityinnodb_io_capacity 10000 200
    innodb_io_capacity_maxinnodb_io_capacity_max 2 * innodb_io_capacity2 * innodb_io_capacity 2 * innodb_io_capacity,最小值默认值为 20002 * innodb_io_capacity, with a minimum default value of 2000
    innodb_log_buffer_sizeinnodb_log_buffer_size 67108864 (64 MiB)67108864 (64 MiB) 16777216 (16 MiB)16777216 (16 MiB)
    innodb_numa_interleaveinnodb_numa_interleave ONON OFFOFF
    innodb_page_cleanersinnodb_page_cleaners innodb_buffer_pool_instancesinnodb_buffer_pool_instances 4
    innodb_parallel_read_threadsinnodb_parallel_read_threads 可用逻辑处理器/8,最小默认值为 4available logical processors / 8, with a minimum default value of 4 4
    innodb_purge_threadsinnodb_purge_threads 如果可用逻辑处理器 <= 16,则为 1,否则为 41 if available logical processors is <= 16, otherwise 4 4
    innodb_read_io_threadsinnodb_read_io_threads 可用逻辑处理器 / 2,最小默认值为 4available logical processors / 2, with a minimum default value of 4 4
    innodb_use_fdatasyncinnodb_use_fdatasync ONON OFFOFF
    temptable_max_ramtemptable_max_ram 总内存的 3%,默认值在 1-4 GiB 范围3% of total memory, with a default value within a range of 1-4 GiB 1073741824 (1 GiB)1073741824 (1 GiB)
    temptable_max_mmaptemptable_max_mmap 0,表示OFF0, which means OFF 1073741824 (1 GiB)1073741824 (1 GiB)
    temptable_use_mmap(在 MySQL 8.0.26 中已弃用)temptable_use_mmap (Deprecated in MySQL 8.0.26) OFFOFF ONON

  • 克隆插件。 放宽了克隆插件版本控制要求,以允许在同一系列的不同点版本之间进行克隆。换句话说,只有主要版本号和次要版本号必须匹配,而以前单点版本号也必须匹配。Clone plugin.  The clone plugin versioning requirement was relaxed to allow cloning between different point releases in the same series. In other words, only the major and minor version numbers must match when previously the point release number also had to match.

    例如,克隆功能现在允许将 8.4.0 克隆到 8.4.14,反之亦然。For example, clone functionality now permits cloning 8.4.0 to 8.4.14 and vice-versa.

  • Windows 上基于 SASL 的 LDAP 身份验证。 在 Microsoft Windows 上,现在支持基于 SASL 的 LDAP 身份验证的服务器插件。这意味着 Windows 客户端现在可以使用 GSSAPI/Kerberos 通过 authentication_ldap_sasl_client 插件进行身份验证。SASL-based LDAP authentication on Windows.  On Microsoft Windows, the server plugin for SASL-based LDAP authentication is now supported. This means that Windows clients can now use GSSAPI/Kerberos for authenticating with the authentication_ldap_sasl_client plugin.

    有关详细信息,请参阅 基于 SASL 的 LDAP 身份验证(无代理)。For more information, see SASL-Based LDAP Authentication (Without Proxying).

  • MySQL 复制:SOURCE_RETRY_COUNT 更改。 SOURCE_RETRY_COUNT 语句的 CHANGE REPLICATION SOURCE TO 选项的默认值已更改为 10。这意味着,使用此选项的默认值SOURCE_CONNECT_RETRY (60),副本在重新连接尝试之间等待 60 秒,并在超时和故障转移之前继续尝试以此速率重新连接 10 分钟。MySQL Replication: SOURCE_RETRY_COUNT change.  The default value for the SOURCE_RETRY_COUNT option of the CHANGE REPLICATION SOURCE TO statement was changed to 10. This means that, using the default values for this option and for SOURCE_CONNECT_RETRY (60), the replica waits 60 seconds between reconnection attempts, and keeps attempting to reconnect at this rate for 10 minutes before timing out and failing over.

    此更改也适用于已弃用的 --master-retry-count 服务器选项。 (您应该使用 SOURCE_RETRY_COUNT。)This change also applies to the default value of the deprecated --master-retry-count server option. (You should use SOURCE_RETRY_COUNT, instead.)

    有关详细信息,请参阅第 19.4.9.1 节“源的异步连接故障转移”。For more information, see Section 19.4.9.1, “Asynchronous Connection Failover for Sources”.

  • MySQL 复制:标记的 GTID。 MySQL 复制和组复制中使用的全局事务标识符 (GID) 的格式已得到扩展,可以识别事务组,从而可以为属于特定事务组的 GTID 分配唯一的名称。例如,只需比较 GTID,即可轻松区分包含数据操作的事务和管理操作产生的事务。MySQL Replication: tagged GTIDs.  The format of global transaction identifiers (GIDs) used in MySQL Replication and Group Replication has been extended to enable identification of groups of transactions, making it possible to assign a unique name to the GTIDs which belong to a specific group of transactions. For example, transactions containing data operations can easily be distinguished from those arising from administrative operations simply by comparing their GTIDs.

    新的 GTID 格式为 UUID:TAG:NUMBER,其中 TAG 是最多 8 个字符的字符串,可通过设置 gtid_next 系统变量改为 AUTOMATIC:TAG,在此版本中添加(有关标签格式和其他信息,请参阅变量的说明)。此标记对于源自当前会话的所有事务持续存在(除非使用 SET gtid_next 进行更改),并在此类事务的提交时应用,或者在使用组复制时在认证时应用。还可以将 gtid_next 设置为 UUID:TAG:NUMBER 将单个事务的 UUID 设置为任意值,并为其分配自定义标签。 UUID 和 NUMBER 的分配与以前的 MySQL 版本相比没有变化。无论哪种情况,用户都有责任确保该标签对于给定的复制拓扑是唯一的。The new GTID format is UUID:TAG:NUMBER, where TAG is a string of up to 8 characters, which is enabled by setting the value of the gtid_next system variable to AUTOMATIC:TAG, added in this release (see the description of the variable for tag format and other information). This tag persists for all transactions originating in the current session (unless changed using SET gtid_next), and is applied at commit time for such transactions, or, when using Group Replication, at certification time. It is also possible to set gtid_next to UUID:TAG:NUMBER to set the UUID of a single transaction to an arbitrary value, along with assigning it a custom tag. The assignments of UUID and NUMBER are otherwise unchanged from previous MySQL releases. In either case, the user is responsible for making sure that the tag is unique to a given replication topology.

    GTID 的原始 UUID:NUMBER 格式继续得到支持,未更改,如在 MySQL 的早期版本中实现的那样;不需要使用 GTID 更改现有复制设置。The original UUID:NUMBER format for GTIDs continues to be supported unchanged, as implemented in previous versions of MySQL; changes to existing replication setups using GTIDs are not required.

    设置gtid_next到AUTOMATIC:TAG或者UUID:TAG:NUMBER需要一个新的TRANSACTION_GTID_TAG在此版本中新增的特权;这在源服务器上以及对于PRIVILEGE_CHECKS_APPLIER用于副本应用程序线程。这也意味着管理员现在可以限制使用SET @gtid_next=AUTOMATIC:TAG或者UUID:TAG:NUMBER到所需的一组 MySQL 用户或角色,以便只有与给定数据或操作域相关的那些用户才能提交带有分配标签的新事务。Setting gtid_next to AUTOMATIC:TAG or UUID:TAG:NUMBER requires a new TRANSACTION_GTID_TAG privilege which is added in this release; this is true both on the originating server as well as for the PRIVILEGE_CHECKS_APPLIER for the replica applier thread. This also means that an administrator can now restrict the use of SET @gtid_next=AUTOMATIC:TAG or UUID:TAG:NUMBER to a desired set of MySQL users or roles so that that only those users related to a given data or operational domain can commit new transactions with assigned tags.

    Note

    从以前版本的 MySQL 升级到 MySQL 8.4 时,任何已拥有 BINLOG_ADMIN 权限的用户帐户或角色都会自动授予 TRANSACTION_GTID_TAG 权限。When upgrading from a previous version of MySQL to MySQL 8.4, any user accounts or roles which already have the BINLOG_ADMIN privilege are automatically granted the TRANSACTION_GTID_TAG privilege.

    内置函数 GTID_SUBSET()、GTID_SUBTRACT() 和 WAIT_FOR_EXECUTED_GTID_SET() 与标记的 GTID 兼容。The built-in functions GTID_SUBSET(), GTID_SUBTRACT(), and WAIT_FOR_EXECUTED_GTID_SET() are compatible with tagged GTIDs.

    有关详细信息,请参阅 gtid_next 系统变量和 TRANSACTION_GTID_TAG 权限,以及 第 19.1.4 节 “更改在线服务器上的 GTID 模式”服务器”。For more information, see the descriptions of the gtid_next system variable and the TRANSACTION_GTID_TAG privilege, as well as Section 19.1.4, “Changing GTID Mode on Online Servers”.

  • 复制:SQL_AFTER_GTIDS 和 MTA。 START REPLICA 语句选项 SQL_AFTER_GTIDS 现在与多线程应用程序兼容。 (以前,当启用 MTA 并且用户尝试使用此选项时,语句会引发警告 ER_MTA_FEATURE_IS_NOT_SUPPORTED,并且副本已切换到单线程模式。)这意味着需要赶上丢失事务的副本现在可以这样做,而不会失去多线程的性能优势。Replication: SQL_AFTER_GTIDS and MTA.  The START REPLICA statement option SQL_AFTER_GTIDS is now compatible with the multi-threaded applier. (Previously, when MTA was enabled and the user attempted to use this option, the statement raised the warning ER_MTA_FEATURE_IS_NOT_SUPPORTED, and the replica was switched to single-threaded mode.) This means that a replica which needs to catch up with missing transactions can now do so without losing the performance advantage from multithreading.

    有关详细信息,请参阅部分 15.4.2.4,“START REPLICA 语句”,以及 replica_parallel_workers 系统变量的文档。另请参阅第 19.2.3.2 节“监视复制应用程序工作线程” 和第 25.7.11 节,“使用多线程应用程序进行 NDB 集群复制”。For more information, see Section 15.4.2.4, “START REPLICA Statement”, as well as the documentation for the replica_parallel_workers system variable. See also Section 19.2.3.2, “Monitoring Replication Applier Worker Threads”, and Section 25.7.11, “NDB Cluster Replication Using the Multithreaded Applier”.

  • 复制术语向后兼容性。 此版本为 mysqldump 添加了 --output-as-version 选项。此选项允许您从与旧版本 MySQL 兼容的 MySQL 8.2 或更高版本服务器创建转储;它的值(此处列出的值之一)确定转储中使用的复制术语的兼容性:Replication terminology backwards compatibility.  This release adds the --output-as-version option for mysqldump. This option allows you to create a dump from a MySQL 8.2 or newer server that is compatible with older versions of MySQL; its value, one of those listed here, determines the compatibility of replication terminology used in the dump:

    • SERVER:获取服务器的版本并使用与该 MySQL 版本兼容的最新版本的复制语句和变量名称。SERVER: Gets the version of the server and uses the latest versions of replication statements and variable names compatible with that MySQL version.

    • BEFORE_8_2_0:输出与运行版本 8.0.23 到 8.1.0 的 MySQL 服务器兼容,BEFORE_8_2_0: Output is compatible with MySQL servers running versions 8.0.23 through 8.1.0, inclusive.

    • BEFORE_8_0_23:输出与运行 8.0.23 之前版本的 MySQL 服务器兼容。BEFORE_8_0_23: Output is compatible with MySQL servers running versions prior to 8.0.23.

    有关详细信息,请参阅此选项的说明。See the description of this option for more information.

    此外,在 terminology_use_previous 系统变量。 BEFORE_8_2_0 导致服务器在 DISABLE ON SLAVE。除了以前已有的值之外,现有值 BEFORE_8_0_26 现在也具有此效果。In addition a new value is added to those already allowed for the terminology_use_previous system variable. BEFORE_8_2_0 causes the server to print DISABLE ON SLAVE (now deprecated) instead of DISABLE ON REPLICA in the output of SHOW CREATE EVENT. The existing value BEFORE_8_0_26 now also has this effect in addition to those it already had previously.

  • 版本特定注释中使用的 MySQL 版本号支持由一位或两位数字组成的主要版本;这意味着整个版本可以是五位或六位数字长。有关此更改如何影响 MySQL 中版本化注释处理的详细信息,请参阅第 11.7 节“注释”。The MySQL version number used in version-specific comments supports a major version consisting of one or two digits; this means that the entire version can be either five or six digits long. For more information about how this change affects handling of versioned comments in MySQL, see Section 11.7, “Comments”.

  • group_replication_set_as_primary() 和 DDL 语句。 group_replication_set_as_primary() 函数等待正在进行的 DDL 语句,例如 ALTER TABLE 等待所有事务完成时,在选择新的主数据库之前。group_replication_set_as_primary() and DDL statements.  The group_replication_set_as_primary() function waits for ongoing DDL statements such as ALTER TABLE when waiting for all transactions to complete, prior to electing a new primary.

    有关详细信息,请参阅此函数的说明。For more information, see the description of this function.

  • group_replication_set_as_primary() 的 DDL 和 DCL 语句跟踪。 group_replication_set_as_primary() 现在会等待以下语句完成,然后再选择新的主数据库:DDL and DCL statement tracking for group_replication_set_as_primary().  group_replication_set_as_primary() now waits for the following statements to complete before a new primary is elected:

    这些是对 MySQL 8.1 中添加的语句或在这方面已支持的语句的补充。有关详细信息,包括 MySQL 8.3 支持的所有此类语句的列表,请参阅 group_replication_set_as_primary() 函数的说明。These are in addition to those statements added in MySQL 8.1 or otherwise already supported in this regard. For more information, including a listing of all such statements supported in MySQL 8.3, see the description of the group_replication_set_as_primary() function.

  • 组复制版本兼容性。 组内服务器的版本兼容性已扩展如下:Group Replication version compatibility.  Version compatibility for servers within groups has been extended as follows:

    MySQL 8.4 LTS 系列支持组内服务器就地降级。例如,运行 MySQL 8.4.2 的组成员可以降级到 MySQL 8.4.0。In-place downgrades of servers within groups are supported within the MySQL 8.4 LTS series. For example, a member of a group running MySQL 8.4.2 can be downgraded to MySQL 8.4.0.

    同样,8.4 版本系列中也支持跨版本组成员身份。例如,运行 MySQL 8.4.0 的服务器可以加入其所有成员当前都运行 MySQL 8.4.2 的组,运行 MySQL 8.4.3 的服务器也可以。Similarly, cross-version group membership is also supported within the 8.4 release series. For example, a server running MySQL 8.4.0 can join a group all of whose members currently run MySQL 8.4.2, as can a server running MySQL 8.4.3.

  • 组复制变量默认值。 MySQL 8.4 中更改了与组复制相关的两个服务器系统变量的默认值:Group Replication variable defaults.  The default values of two server system variables relating to Group Replication have been changed in MySQL 8.4:

    有关详细信息,请参阅第 20.5.3.2 节“配置事务一致性保证”和第 20.7.7 节“对故障检测和网络分区的响应”,以及所列变量的说明。For more information, see Section 20.5.3.2, “Configuring Transaction Consistency Guarantees”, and Section 20.7.7, “Responses to Failure Detection and Network Partitioning”, as well as the descriptions of the variables listed.

  • 添加了一些特定于组复制插件的状态变量,可改进网络不稳定性的诊断和故障排除,提供有关网络使用情况、控制消息和数据消息的统计信息每个小组成员。Added a number of status variables specific to the Group Replication plugin that improve diagnosis and troubleshooting of network instabilities, providing statistics about network usage, control messages, and data messages for each group member.

    有关详细信息,请参阅第 20.9.2 节“组复制状态变量”。See Section 20.9.2, “Group Replication Status Variables”, for more information.

    作为这项工作的一部分,性能架构中添加了一个新的 MEMBER_FAILURE_SUSPICIONS_COUNT 列replication_group_communication_information 表。此列的内容格式为 JSON 数组,其键是组成员 ID,其值是组成员被视为可疑的次数。有关详细信息,请参阅此表的说明。As part of this work, a new MEMBER_FAILURE_SUSPICIONS_COUNT column was added to the Performance Schema replication_group_communication_information table. The contents of this column are formatted as a JSON array whose keys are group members ID and whose values are the number of times the group member has been considered suspect. See the description of this table for more information.

  • FLUSH_PRIVILEGES 权限。 MySQL 8.4.0 中添加了一个新权限,专门允许使用 FLUSH PRIVILEGES 语句。与 RELOAD 权限不同,FLUSH_PRIVILEGES 权限仅适用于 FLUSH PRIVILEGESFLUSH_PRIVILEGES privilege.  A new privilege is added in MySQL 8.4.0 specifically to allow use of FLUSH PRIVILEGES statements. Unlike the RELOAD privilege, the FLUSH_PRIVILEGES privilege applies only to FLUSH PRIVILEGES statements.

    在 MySQL 8.4 中,继续支持 RELOAD 权限,以提供向后兼容性。In MySQL 8.4, the RELOAD privilege continues to be supported in this capacity to provide backwards compatibility.

    升级时,会检查是否有任何用户拥有 FLUSH_PRIVILEGES 权限;如果没有,则任何具有 RELOAD 权限的用户也会自动分配新权限。When upgrading, a check is performed to see whether there are any users having the FLUSH_PRIVILEGES privilege; if there are none, any users having the RELOAD privilege are automatically assigned the new privilege as well.

    如果您从 MySQL 8.4(或更高版本)降级到不支持 FLUSH_PRIVILEGES 权限,之前授予此权限的用户无法执行 FLUSH PRIVILEGES 语句,除非用户拥有 RELOAD 权限。If you downgrade from MySQL 8.4 (or later) to a version of MySQL which does not support the FLUSH_PRIVILEGES privilege, a user previously granted this privilege is unable to execute FLUSH PRIVILEGES statements unless the user has the RELOAD privilege.

  • OPTIMIZE_LOCAL_TABLE 权限。 MySQL 8.4.0 添加了新的 OPTIMIZE_LOCAL_TABLE 权限。用户必须具有此权限才能执行 OPTIMIZE LOCAL TABLE 和 OPTIMIZE NO_WRITE_TO_BINLOG TABLE 语句。OPTIMIZE_LOCAL_TABLE privilege.  MySQL 8.4.0 adds a new OPTIMIZE_LOCAL_TABLE privilege. Users must have this privilege to execute OPTIMIZE LOCAL TABLE and OPTIMIZE NO_WRITE_TO_BINLOG TABLE statements.

    从以前的版本系列升级时,拥有 SYSTEM_USER 权限的用户将自动被授予 OPTIMIZE_LOCAL_TABLE 权限。When upgrading from a previous release series, users having the SYSTEM_USER privilege are automatically granted the OPTIMIZE_LOCAL_TABLE privilege.

  • MySQL 企业数据脱敏和去识别。数据屏蔽组件添加了对指定专用模式来存储相关内部表和屏蔽函数的支持。以前,mysql 系统架构提供了唯一的存储选项。新的 component_masking.masking_database 只读变量允许在服务器启动时设置和保留备用架构名称。MySQL Enterprise Data Masking and De-Identification.  Data-masking components added support for specifying a dedicated schema to store the related internal table and masking functions. Previously, the mysql system schema provided the only storage option. The new component_masking.masking_database read-only variable enables setting and persisting an alternative schema name at server startup.

  • 刷新数据屏蔽字典。 MySQL Enterprise Data Masking 和 De-Identification 组件现在包含将辅助副本或副本上的数据刷新到内存中的功能。这可以通过此处描述的任一方式完成:Flushing of data masking dictionaries.  The MySQL Enterprise Data Masking and De-Identification component now includes the ability to flush the data on the secondary or replica into memory. This can be done in either of the ways described here:

    有关详细信息,请参阅第 8.5 节“MySQL Enterprise 数据脱敏和去识别”以及这些项目的说明。For more information, see Section 8.5, “MySQL Enterprise Data Masking and De-Identification”, and the descriptions of these items.

  • 自动柱状图更新。 MySQL 8.4.0 添加了对直方图自动更新的支持。当为给定直方图启用此功能时,只要在其所属的表上运行 ANALYZE TABLE,该直方图就会更新。此外,InnoDB 自动重新计算持久统计信息(请参阅第 17.8.10.1 节, “配置持久优化器统计参数”)也会更新直方图。直方图更新继续使用与最初指定的相同数量的存储桶(如果有)。Automatic histogram updates.  MySQL 8.4.0 adds support for automatic updates of histograms. When this feature is enabled for a given histogram, it is updated whenever ANALYZE TABLE is run on the table to which it belongs. In addition, automatic recalculation of persistent statistics by InnoDB (see Section 17.8.10.1, “Configuring Persistent Optimizer Statistics Parameters”) also updates the histogram. Histogram updates continue to use the same number of buckets as they were originally specified with, if any.

    您可以在指定直方图时启用此功能,方法是在 ANALYZE TABLE 语句中包含 AUTO UPDATE 选项。要禁用它,请改为包含 MANUAL UPDATE。如果未指定任何选项,则默认为MANUAL UPDATE(无自动更新)。You can enable this feature when specifying the histogram by including the AUTO UPDATE option for the ANALYZE TABLE statement. To disable it, include MANUAL UPDATE instead. MANUAL UPDATE (no automatic updates) is the default if neither option is specified.

    有关详细信息,请参阅直方图统计分析。For more information, see Histogram Statistics Analysis.

  • 添加了 tls-certificates-enforced-validation 系统变量,该变量允许 DBA 在服务器启动时或使用 ALTER INSTANCE RELOAD TLS 语句用于在运行时重新加载证书。启用强制执行后,发现无效证书会在启动时停止服务器调用,防止在运行时加载无效证书,并发出警告。有关详细信息,请参阅配置证书验证强制。Added the tls-certificates-enforced-validation system variable, which permits a DBA to enforce certificate validation at server startup or when using the ALTER INSTANCE RELOAD TLS statement to reload certificates at runtime. With enforcement enabled, discovering an invalid certificate halts server invocation at startup, prevents loading invalid certificates at runtime, and emits warnings. For more information, see Configuring Certificate Validation Enforcement.

  • 添加了服务器系统变量,用于控制在 LDAP 服务器关闭或无响应时,使用 LDAP 可插入身份验证连接到 MySQL 服务器的 MySQL 帐户必须等待的时间。以下简单和基于 SASL 的 LDAP 身份验证变量的默认超时变为 30 秒:Added server system variables to control the amount of time MySQL accounts that connect to a MySQL server using LDAP pluggable authentication must wait when the LDAP server is down or unresponsive. The default timeout became 30 seconds for the following simple and SASL-based LDAP authentication variables:

    连接和响应超时只能通过 Linux 平台上的系统变量进行配置。有关详细信息,请参阅设置 LDAP 可插入身份验证的超时。Connection and response timeouts are configurable through the system variables on Linux platforms only. For more information, see Setting Timeouts for LDAP Pluggable Authentication.

  • 关闭过程的日志记录得到增强,添加了 MySQL 服务器、插件和组件的启动和关闭消息。现在,关闭连接时也会记录此类消息。这些添加内容应该有助于故障排除和调试问题,特别是在服务器关闭时间过长的情况下。Logging of the shutdown process was enhanced, with the addition of startup and shutdown messages for the MySQL server, plugins, and components. Such messages are now also logged for closing connections. These additions should facilitate troubleshooting and debugging problems, particularly in the event that the server takes an excessively long time to shut down.

    有关详细信息,请参阅第 7.4.2 节“错误日志”。For more information, see Section 7.4.2, “The Error Log”.

  • 对服务器启动和关闭消息的添加。 在服务器启动和关闭过程中添加了以下类型的消息,如下列表所示:Additions to server startup and shutdown messages.  Added the following types of messages to the server startup and shutdown processes as noted in this list:

    • 当服务器使用 --initialize 或 --initialize-insecure;这些是对正常服务器启动和关闭期间显示的内容的补充和区别。Start and end messages for server initialization when the server is started with --initialize or --initialize-insecure; these are in addition to and distinct from those shown during normal server startup and shutdown.

    • InnoDB 初始化的开始和结束消息。Start and end messages for InnoDB initialization.

    • 服务器初始化期间 init 文件执行的开始和结束消息。Start and end messages for init file execution during server initialization.

    • 服务器初始化期间执行编译语句的开始和结束消息。Start and end messages for for execution of compiled-in statements during server initialization.

    • 服务器启动期间崩溃恢复的开始和结束消息(如果发生崩溃恢复)。Start and end mesages for crash recovery during server startup (if crash recovery occurs).

    • 服务器启动期间动态插件初始化的开始和结束消息。Start and end messages for initialization of dynamic plugins during server startup.

    • 开始和结束消息组件初始化步骤的结束消息(在服务器启动期间明显)。Start and end messages for compoenents initialization step (apparent during server startup).

    • 在服务器关闭期间关闭副本线程以及正常强制关闭连接线程的消息。Messages for shutdown of replica threads, as well as graceful and forceful shutdown of connection threads, during server shutdown.

    • 在服务器关闭期间关闭插件和组件的开始和结束消息。Start and end messages for shutdown of plugins and components during server shutdown.

    • 在初始化或服务器关闭和结束期间退出代码(返回值)信息以及关闭消息Exit code (return value) information with shutdown messages during initialization or server shutdown and end)

    此外,如果服务器是使用 WITH_SYSTEMD,服务器现在在错误日志中包含每条 systemd 消息。In addition, if the server was built using WITH_SYSTEMD, the server now includes every systemd message in the error log.

  • 添加了 SHOW PARSE_TREE 语句,显示 SELECT 语句的 JSON 格式解析树。此声明仅供测试和开发使用,不适用于生产。它仅在调试版本中可用,或者如果 MySQL 是使用 CMake -DWITH_SHOW_PARSE_TREE 选项从源代码构建的,并且在发布版本中不包含或不支持。Added the SHOW PARSE_TREE statement, which shows the JSON-formatted parse tree for a SELECT statement. This statement is intended for testing and development use only, and not in production. It is available only in debug builds, or if MySQL was built from source using the CMake -DWITH_SHOW_PARSE_TREE option, and is not included or supported in release builds.

  • 线程池插件连接信息。 向 MySQL 性能架构中添加了线程池连接信息,如下所示:Thread pool plugin connection information.  Added thread pool connection information to the MySQL Performance Schema, as follows:

    • 添加了一个 tp_connections 表,其中包含有关每个线程池连接的信息。Added a tp_connections table, with information about each thread pool connection.

    • 向 tp_thread_state 表:TIME_OF_ATTACH、MARKED_STALLED、STATE、EVENT_COUNT、ACCUMULATED_EVENT_TIME、EXEC_COUNT 和 ACCUMULATED_EXEC_TIMEAdded the following columns to the tp_thread_state table: TIME_OF_ATTACH, MARKED_STALLED, STATE, EVENT_COUNT, ACCUMULATED_EVENT_TIME, EXEC_COUNT, and ACCUMULATED_EXEC_TIME

    • 向 tp_thread_group_state 表添加了以下列:EFFECTIVE_MAX_TRANSACTIONS_LIMIT,NUM_QUERY_THREADS、TIME_OF_LAST_THREAD_CREATION、NUM_CONNECT_HANDLER_THREAD_IN_SLEEP、THREADS_BOUND_TO_TRANSACTION、QUERY_THREADS_COUNT 和 TIME_OF_EARLIEST_CON_EXPIRE。Added the following columns to the tp_thread_group_state table: EFFECTIVE_MAX_TRANSACTIONS_LIMIT, NUM_QUERY_THREADS, TIME_OF_LAST_THREAD_CREATION, NUM_CONNECT_HANDLER_THREAD_IN_SLEEP, THREADS_BOUND_TO_TRANSACTION, QUERY_THREADS_COUNT, and TIME_OF_EARLIEST_CON_EXPIRE.

    有关详细信息,请参阅第 7.6.3 节“MySQL Enterprise 线程池”和第 29.12.16 节,“性能架构线程池表”。For more information, see Section 7.6.3, “MySQL Enterprise Thread Pool”, and Section 29.12.16, “Performance Schema Thread Pool Tables”.

  • 信息架构 PROCESSLIST 表使用情况。 尽管 INFORMATION_SCHEMA.PROCESSLIST 表在 MySQL 8.0.35 和 8.2.0 中已被弃用,但人们仍然对跟踪其使用情况感兴趣。此版本添加了两个系统状态变量,提供有关访问 PROCESSLIST 表的信息,如下所示:Information Schema PROCESSLIST table usage.  Although the INFORMATION_SCHEMA.PROCESSLIST table was deprecated in MySQL 8.0.35 and 8.2.0, interest remains in tracking its usage. This release adds two system status variables providing information about accesses to the PROCESSLIST table, listed here:

  • 集合操作的哈希表优化。 MySQL 8.2 通过自动启用的新哈希表优化,提高了使用集合操作 EXCEPT 和 INTERSECT 语句的性能对于此类语句,并通过设置 hash_set_operations 优化器开关进行控制;要禁用此优化并使优化器使用以前版本的 MySQL 中的旧临时表优化,请将此标志设置为 off。Hash table optimization for set operations.  MySQL 8.2 improves performance of statements using the set operations EXCEPT and INTERSECT by means of a new hash table optimization which is enabled automatically for such statements, and controlled by setting the hash_set_operations optimizer switch; to disable this optimization and cause the optimizer to used the old temporary table optimization from previous versions of MySQL, set this flag to off.

    为此优化分配的内存量可以通过设置 set_operations_buffer_size 服务器系统的值来控制变量;增加缓冲区大小可以进一步缩短使用这些操作的某些语句的执行时间。The amount of memory allocated for this optimization can be controlled by setting the value of the set_operations_buffer_size server system variable; increasing the buffer size can further improve execution times of some statements using these operations.

    有关详细信息,请参阅第 10.9.2 节“可切换优化”。See Section 10.9.2, “Switchable Optimizations”, for more information.

  • WITH_LD CMake 选项。 WITH_LD:定义是否使用 llvm lld 或 mold 链接器,否则使用标准链接器。 WITH_LD 还替换了 USE_LD_LLD CMake 选项已在 MySQL 8.3.0 中删除。WITH_LD CMake option.  WITH_LD: Define whether to use the llvm lld or mold linker, otherwise use the standard linker. WITH_LD also replaces the USE_LD_LLD CMake option that was removed in MySQL 8.3.0.

  • MySQL 企业防火墙增强功能。 自 MySQL 8.0 以来,MySQL Enterprise Firewall 进行了许多增强。这些列于此处:MySQL Enterprise Firewall enhancements.  A number of enhancements were made since MySQL 8.0 to MySQL Enterprise Firewall. These are listed here:

    • MySQL Enterprise Firewall 提供的存储过程现在以事务方式运行。当防火墙存储过程执行期间发生错误时,会报告错误,并且回滚该存储过程截至该时间点所做的所有更改。Stored procedures provided by MySQL Enterprise Firewall now behave in transactional fashion. When an error occurs during execution of a firewall stored procedure, an error is reported, and all changes made by the stored procedure up to that point in time are rolled back.

    • 防火墙存储过程现在可以避免执行不必要的 DELETE 加上 INSERT 语句,以及 INSERT IGNORE 加上 UPDATE 操作,从而消耗更少的时间和资源,使它们更快、更高效。Firewall stored procedures now avoid performing unnecessary combinations of DELETE plus INSERT statements, as well as those of INSERT IGNORE plus UPDATE operations, thus consuming less time and fewer resources, making them faster and more efficient.

    • 基于用户的存储过程和 UDF,在 MySQL 8.0.26 中已弃用,现在会发出弃用警告。特别调用 sp_set_firewall_mode() 或 sp_reload_firewall_rules() 会生成此类警告。有关详细信息,请参阅防火墙帐户配置文件存储过程以及将帐户配置文件迁移到组配置文件。信息。User-based stored procedures and UDFs, deprecated in MySQL 8.0.26, now raise a deprecation warning. Specifically calling either of sp_set_firewall_mode() or sp_reload_firewall_rules() generates such a warning. See Firewall Account Profile Stored Procedures, as well as Migrating Account Profiles to Group Profiles, for more information.

    • MySQL 企业防火墙现在允许使用防火墙表中存储的数据定期重新加载其内存缓存。 mysql_firewall_reload_interval_seconds 系统变量设置运行时使用的定期重新加载计划,或者默认情况下禁用重新加载。以前的实现仅在服务器启动时或重新安装服务器端插件时重新加载缓存。MySQL Enterprise Firewall now permits its memory cache to be reloaded periodically with data stored in the firewall tables. The mysql_firewall_reload_interval_seconds system variable sets the periodic-reload schedule to use at runtime or it disables reloads by default. Previous implementations reloaded the cache only at server startup or when the server-side plugin was reinstalled.

    • 添加了 mysql_firewall_database 服务器系统变量,以支持在自定义架构中存储内部表、函数和存储过程。Added the mysql_firewall_database server system variable to enable storing internal tables, functions, and stored procedures in a custom schema.

    • 添加了 uninstall_firewall.sql 脚本,用于简化删除已安装的防火墙的操作。Added the uninstall_firewall.sql script to simplify removing an installed firewall.

    有关防火墙存储过程的详细信息,请参阅MySQL 企业防火墙存储过程。For more information about firewall stored procedures, see MySQL Enterprise Firewall Stored Procedures.

  • 可插入身份验证。 添加了对在 WebAuthn 上下文中使用智能卡、安全密钥和生物识别读取器等设备对 MySQL Server 进行身份验证的支持。新的 WebAuthn 身份验证方法基于 FIDO 和 FIDO2 标准。它使用一对插件,服务器端的 authentication_webauthn 和客户端的 authentication_webauthn_client。服务器端 WebAuthn 身份验证插件仅包含在 MySQL Enterprise Edition 发行版中。Pluggable authentication.  Added support for authentication to MySQL Server using devices such as smart cards, security keys, and biometric readers in a WebAuthn context. The new WebAuthn authentication method is based on the FIDO and FIDO2 standards. It uses a pair of plugins, authentication_webauthn on the server side and authentication_webauthn_client on the client side. The server-side WebAuthn authentication plugin is included only in MySQL Enterprise Edition distributions.

  • 密钥环迁移。 支持从密钥环组件迁移到密钥环插件。要执行此类迁移,请使用 MySQL 8.4.0 中引入的 --keyring-migration-from-component 服务器选项,设置 --keyring-migration-source 为源组件的名称,--keyring-migration-destination 为目标插件的名称。Keyring migration.  Migration from a keyring component to a keyring plugin is supported. To perform such a migration, use the --keyring-migration-from-component server option introduced in MySQL 8.4.0, setting --keyring-migration-source to the name of the source component, and --keyring-migration-destination the name of the target plugin.

    请参阅使用迁移服务器进行密钥迁移,了解更多信息。See Key Migration Using a Migration Server, for more information.

  • MySQL Enterprise Audit。 添加了 audit_log_filter_uninstall.sql 脚本以简化删除 MySQL Enterprise Audit 的过程。MySQL Enterprise Audit.  Added the audit_log_filter_uninstall.sql script to simplify removing MySQL Enterprise Audit.

  • 新关键字。 自 MySQL 8.0 以来 MySQL 8.4 添加的关键字。保留关键字用 (R) 标记。New Keywords.  Keywords added in MySQL 8.4 since MySQL 8.0. Reserved keywords are marked with (R).

    AUTO、BERNOULLI、GTIDS、LOG、MANUAL (R)、PARALLEL (R)、PARSE_TREE、 QUALIFY (R)、S3 和 TABLESAMPLE (R)。AUTO, BERNOULLI, GTIDS, LOG, MANUAL (R), PARALLEL (R), PARSE_TREE, QUALIFY (R), S3, and TABLESAMPLE (R).

  • 抢占组复制认证垃圾回收。 MySQL 8.4.0 中添加的系统变量 group_replication_preemptive_garbage_collection 为在单主模式下运行的组复制启用抢占式垃圾收集,仅保留那些尚未提交的事务的写入集。这可以节省时间和内存消耗。额外的系统变量group_replication_preemptive_garbage_collection_rows_threshold(也在 MySQL 8.4.0 中引入)设置了触发抢占式垃圾收集所需的认证行数的下限,如果它已启用;默认为 100000。Preemptive group replication certification garbage collection.  A system variable added in MySQL 8.4.0 group_replication_preemptive_garbage_collection enables preemptive garbage collection for group replication running in single-primary mode, keeping only the write sets for those transactions that have not yet been committed. This can save time and memory consumption. An additional system variable group_replication_preemptive_garbage_collection_rows_threshold (also introduced in MySQL 8.4.0) sets a lower limit on the number of certification rows needed to trigger preemptive garbage collection if it is enabled; the default is 100000.

    在多主模式下,从事务被认证到在所有成员上提交,认证信息中的每个写入集都是需要的,这使得需要检测事务之间的冲突。在单主模式下,我们只需要关心事务依赖,这不是问题;这意味着只有在认证完成之前才需要保留写入集。In multi-primary mode, each write set in the certification information is required from the moment a transaction is certified until it is committed on all members, which makes it necessary to detect conflicts between transactions. In single-primary mode, where we need be concerned only about transaction dependencies, this is not an issue; this means write sets need be kept only until certification is complete.

    启用 group_replication_preemptive_garbage_collection 后,无法更改单主和多主之间的组复制模式。It is not possible to change the group replication mode between single-primary and multi-primary when group_replication_preemptive_garbage_collection is enabled.

    请参阅第 20.7.9 节“使用 Performance Schema Memory Instrumentation 监视组复制内存使用情况”,帮助获取有关此进程消耗的内存的信息。See Section 20.7.9, “Monitoring Group Replication Memory Usage with Performance Schema Memory Instrumentation”, for help with obtaining information about memory consumed by this process.

  • 清理的中继日志恢复。 在 MySQL 8.4.0 及更高版本中,可以在删除任何不完整事务的情况下恢复中继日志。现在,当服务器以 --relay-log-recovery=OFF(默认值)启动时,中继日志会被清理,这意味着以下所有项目都将被删除:Sanitized relay log recovery.  In MySQL 8.4.0 and later, it is possible to recover the relay log with any incomplete transactions removed. The relay log is now sanitized when the server is started with --relay-log-recovery=OFF (the default), meaning that all of the following items are removed:

    • 在中继日志末尾仍未完成的事务Transactions which remain uncompleted at the end of the relay log

    • 包含以下内容的中继日志文件仅不完整的事务或其部分Relay log files containing incomplete transactions or parts thereof only

    • 中继日志索引文件中对已被删除的中继日志文件的引用References in the relay log index file to relay log files which have thus been removed

    有关详细信息,请参阅relay_log_recovery 服务器系统变量的说明。For more information, see the description of the relay_log_recovery server system variable.

  • MySQL 升级历史文件。 作为 MySQL 8.4.0 及更高版本中安装过程的一部分,会在服务器的数据目录中创建一个名为 mysql_upgrade_history 的 JSON 格式文件,如果该文件已存在,则进行更新。此文件包含有关已安装的 MySQL 服务器版本、安装时间以及该版本是否属于 LTS 系列或 Innovation 系列的信息。MySQL upgrade history file.  As part of the installation process in MySQL 8.4.0 and later, a file in JSON format named mysql_upgrade_history is created in the server's data directory, or updated if it already exists. This file includes information about the MySQL server version installed, when it was installed, and whether the release was part of an LTS series or an Innovation series.

    典型的 mysql_upgrade_history 文件可能如下所示(为便于阅读而调整格式):A typical mysql_upgrade_history file might look something like this (formatting adjusted for readability):

    {
      "file_format":"1",
    
      "upgrade_history":
      [
        {
          "date":"2024-03-15 22:02:35",
          "version":"8.4.0",
          "maturity":"LTS",
          "initialize":true
        },
    
        {
          "date":"2024-05-17 17:46:12",
          "version":"8.4.1",
          "maturity":"LTS",
          "initialize":false
        }
      ]
    
    }
    

    此外,安装过程现在会检查是否存在 mysql_upgrade_info 文件(在 MySQL 中已弃用) 8.0,不再使用)。如果找到,则删除该文件。In addition, the installation process now checks for the presence of a mysql_upgrade_info file (deprecated in MySQL 8.0, and is no longer used). If found, the file is removed.

  • mysql 客户端 --system-command 选项。 mysql 客户端的 --system-command 选项,可在 MySQL 中使用 8.4.3 及更高版本,启用或禁用 system 命令。mysql client --system-command option.  The --system-command option for the mysql client, available in MySQL 8.4.3 and later, enables or disables the system command.

    此选项默认启用。要禁用它,请使用 --system-command=OFF 或 --skip-system-command,这会导致 system 命令被拒绝并出现错误。This option is enabled by default. To disable it, use --system-command=OFF or --skip-system-command, which causes the system command to be rejected with an error.

  • mysql 客户端 --commands 选项。 mysql 客户端 --commands 选项,在 MySQL 8.4.6 中引入,支持或禁用大多数 mysql 客户端命令。mysql client --commands option.  The mysql client --commands option, introduced in MySQL 8.4.6, enables or disables most mysql client commands.

    此选项默认启用。要禁用它,请启动mysql客户与--commands=OFF或者--skip-commands.This option is enabled by default. To disable it, start the mysql client with --commands=OFF or --skip-commands.

    有关详细信息,请参阅第 6.5.1.1 节“mysql 客户端”选项”。For more information, see Section 6.5.1.1, “mysql Client Options”.

  • 与派生表的标量相关子查询。 MySQL 8.4.0 取消了之前将相关标量子查询转换为派生表的限制,使得不包含外部引用的等式表达式的操作数只能是简单的列引用。Scalar correlated subqueries to derived tables.  MySQL 8.4.0 lifts a previous restriction on transforming a correlated scalar subquery to a derived table such that an operand of the equality expression which did not contain an outer reference could be a simple column reference only.

    这意味着内部列可以包含在确定性表达式中,如下所示:This means that inner columns can be contained in deterministic expressions, as shown here:

          
    func1(.., funcN(.., inner-column-a, ..), inner-column-b) = outside-expression
    
    inner-column-a + inner-column-b = outside-expression
    

    例如,现在支持以下查询进行优化:For example, the following query is now supported for optimization:

    SELECT * FROM t1 
      WHERE ( SELECT func(t2.a) FROM t2 
                WHERE func(t2.a) = t1.a ) > 0;
    

    内部操作数不能包含外部列引用;同样,外部操作数不能包含内部列引用。另外,内部操作数不能包含子查询。The inner operand cannot contain outer column references; likewise, the outer operand cannot contain inner column references. In addition, the inner operand cannot contain a subquery.

    如果转换后的子查询具有明确的分组,函数依赖分析可能会过于悲观,导致诸如以下的错误错误 1055 (42000):SELECT 列表中的表达式 #2 不在 GROUP BY 子句中,并且包含未聚合的列 .... 对于InnoDB存储引擎,转换默认情况下是禁用的(也就是说,subquery_to_derived……的旗optimizer_switch变量未启用); 在这种情况下,这些查询会通过而不会引发任何错误,但也不会被转换。If the transformed subquery has explicit grouping, functional dependency analysis may be excessively pessimistic, resulting in an error such as ERROR 1055 (42000): Expression #2 of SELECT list is not in GROUP BY clause and contains nonaggregated column .... For the InnoDB storage engine, the transform is disabled by default (that is, the subquery_to_derived flag of the optimizer_switch variable is not enabled); in this case, such queries pass without raising any errors, but are also not transformed.

    有关详细信息,请参阅第 15.2.15.7 节“相关子查询”。See Section 15.2.15.7, “Correlated Subqueries”, for more information.

功能在 MySQL 8.4 中已弃用Features Deprecated in MySQL 8.4

以下功能在 MySQL 8.4 中已弃用,并且可能会在未来的系列中删除。如果显示替代方案,则应更新应用程序以使用它们。The following features are deprecated in MySQL 8.4 and may be removed in a future series. Where alternatives are shown, applications should be updated to use them.

对于使用 MySQL 8.4 中已弃用且已在更高 MySQL 版本中删除的功能的应用程序,从 MySQL 8.4 源复制到运行更高版本的副本时,语句可能会失败,或者可能对源和副本产生不同的影响。为了避免此类问题,应修改使用 8.4 中已弃用功能的应用程序以避免这些问题,并尽可能使用替代方案。For applications that use features deprecated in MySQL 8.4 that have been removed in a later MySQL version, statements may fail when replicated from a MySQL 8.4 source to a replica running a later version, or may have different effects on source and replica. To avoid such problems, applications that use features deprecated in 8.4 should be revised to avoid them and use alternatives when possible.

  • group_replication_allow_local_lower_version_join 系统变量。 group_replication_allow_local_lower_version_join 系统变量已弃用,设置它会导致警告 (ER_WARN_DEPRECATED_SYNTAX_NO_REPLACEMENT)将被记录。group_replication_allow_local_lower_version_join system variable.  The group_replication_allow_local_lower_version_join system variable is deprecated, and setting it causes a warning (ER_WARN_DEPRECATED_SYNTAX_NO_REPLACEMENT) to be logged.

    您应该期待这一点变量将在 MySQL 的未来版本中删除。由于通过设置 group_replication_allow_local_lower_version_join 启用的功能不再有用,因此不计划对其进行替代。You should expect this variable to be removed in a future version of MySQL. Since the functionality enabled by setting group_replication_allow_local_lower_version_join is no longer useful, no replacement for it is planned.

  • 组复制恢复元数据。 组复制恢复不再依赖于将视图更改事件写入二进制日志来标记组成员身份的更改;相反,当组中的所有成员都是 MySQL 8.3.0 或更高版本时,成员共享压缩的恢复元数据,并且当新成员加入组时不会记录此类事件(或分配 GTID)。Group Replication recovery metadata.  Group Replication recovery no longer depends on writing of view change events to the binary log to mark changes in group membership; instead, when all members of a group are MySQL version 8.3.0 or later, members share compressed recovery metadata, and no such event is logged (or assigned a GTID) when a new member joins the group.

    恢复元数据包括 GCS 视图 ID、已认证事务的 GTID_SET 和认证信息以及在线成员列表。Recovery metadata includes the GCS view ID, GTID_SET of certified transactions, and certification information, as well as a list of online members.

    自 View_change_log_event 不再在恢复中发挥作用,不再需要 group_replication_view_change_uuid 系统变量,因此现已弃用;预计它会在未来的 MySQL 版本中被删除。您应该注意,没有计划替换或替代此变量或其功能,并相应地开发您的应用程序。Since View_change_log_event no longer plays a role in recovery, the group_replication_view_change_uuid system variable is no longer needed, and so is now deprecated; expect its removal in a future MySQL release. You should be aware that no replacement or alternative for this variable or its functionality is planned, and develop your applications accordingly.

  • WAIT_UNTIL_SQL_THREAD_AFTER_GTIDS() 函数。 WAIT_UNTIL_SQL_THREAD_AFTER_GTIDS() SQL 函数在 MySQL 8.0 中已弃用,并且从 MySQL 8.2 起不再受支持。现在尝试调用此函数会导致语法错误。WAIT_UNTIL_SQL_THREAD_AFTER_GTIDS() function.  The WAIT_UNTIL_SQL_THREAD_AFTER_GTIDS() SQL function was deprecated in MySQL 8.0, and is no longer supported as of MySQL 8.2. Attempting to invoke this function now causes a syntax error.

    而不是WAIT_UNTIL_SQL_THREAD_AFTER_GTIDS(),建议您使用WAIT_FOR_EXECUTED_GTID_SET(),这允许您等待特定的 GTID。这无论指定的事务通过哪个复制通道或用户客户端到达服务器都有效。Instead of WAIT_UNTIL_SQL_THREAD_AFTER_GTIDS(), it is recommended that you use WAIT_FOR_EXECUTED_GTID_SET(), which allows you to wait for specific GTIDS. This works regardless of the replication channel or the user client through which the specified transactions arrive on the server.

  • 基于 GTID 的复制和 IGNORE_SERVER_IDS。 当使用全局事务标识符 (GTID) 进行复制时,已应用的事务将被自动忽略。这意味着 IGNORE_SERVER_IDS 与 GTID 模式不兼容。如果 gtid_mode 为 ON,则 CHANGE REPLICATION SOURCE TO 会被拒绝并出现错误。同样,如果使用要忽略的服务器 ID 列表创建任何现有复制通道,SET gtid_mode=ON 也会被拒绝。在开始基于 GTID 的复制之前,检查并清除所涉及服务器上任何被忽略的服务器 ID 列表;您可以通过检查 SHOW REPLICA STATUS 的输出来完成此操作。在这种情况下,您可以通过发出带有空服务器 ID 列表的 CHANGE REPLICATION SOURCE TO 来清除列表,如下所示:GTID-based replication and IGNORE_SERVER_IDS.  When global transaction identifiers (GTIDs) are used for replication, transactions that have already been applied are automatically ignored. This means that IGNORE_SERVER_IDS is not compatible with GTID mode. If gtid_mode is ON, CHANGE REPLICATION SOURCE TO with a non-empty IGNORE_SERVER_IDS list is rejected with an error. Likewise, if any existing replication channel was created with a list of server IDs to be ignored, SET gtid_mode=ON is also rejected. Before starting GTID-based replication, check for and clear any ignored server ID lists on the servers involved; you can do this by checking the output from SHOW REPLICA STATUS. In such cases, you can clear the list by issuing CHANGE REPLICATION SOURCE TO with an empty list of server IDs, as shown here:

    CHANGE REPLICATION SOURCE TO IGNORE_SERVER_IDS = ();
    

    请参阅 第 19.1.3.7 节,“使用 GTID 进行复制的限制” GTID”,了解更多信息。See Section 19.1.3.7, “Restrictions on Replication with GTIDs”, for more information.

  • 二进制日志事务依赖性跟踪和日志记录格式。 使用写入集信息进行冲突检测已被发现会导致依赖性跟踪问题;因此,我们现在限制在基于行的日志记录生效时使用写入集进行冲突检查。Binary log transaction dependency tracking and logging format.  Using writeset information for conflict detection has been found to cause issues with dependency tracking; for this reason, we now limit the usage of writesets for conflict checks to when row-based logging is in effect.

    这意味着,在这种情况下,binlog_format 必须是 ROW,并且 MIXED 不是不再支持。This means that, in such cases, binlog_format must be ROW, and MIXED is no longer supported.

  • expire_logs_days 系统变量。 expire_logs_days 服务器系统变量(在 MySQL 8.0 中已弃用)已被删除。尝试在运行时获取或设置此变量,或使用等效选项 (--expire-logs-days) 启动 mysqld 现在会导致错误。expire_logs_days system variable.  The expire_logs_days server system variable, deprecated in MySQL 8.0, has been removed. Attempting to get or set this variable at runtime, or to start mysqld with the equivalent option (--expire-logs-days), now results in an error.

    代替 expire_logs_days,使用binlog_expire_logs_seconds,它允许您指定(仅)整数天以外的过期时间。In place of expire_logs_days, use binlog_expire_logs_seconds, which allows you to specify expiration periods other than (only) in an integral number of days.

  • 数据库授权中的通配符。 在数据库授权中使用字符 % 和 _ 作为通配符在 MySQL 8.2.0 中已被弃用。您应该期望在未来的 MySQL 版本中删除通配符功能,并且这些字符始终被视为文字,因为每当 partial_revokes 服务器系统变量的值为 ON 时,它们就已经被视为文字。Wildcard characters in database grants.  The use of the characters % and _ as wildcards in database grants was deprecated in MySQL 8.2.0. You should expect for the wildcard functionality to removed in a future MySQL release and for these characters always to be treated as literals, as they are already whenever the value of the partial_revokes server system variable is ON.

    此外,% 作为 localhost 的同义词现在也已被弃用,因此可能会在未来版本的 MySQL 中删除。In addition, the treatment of % by the server as a synonym for localhost when checking privileges is now also deprecated as of MySQL 8.2.0 and thus subject to removal in a future version of MySQL.

  • --character-set-client-handshake 选项。 --character-set-client-handshake 服务器选项最初用于从非常旧的 MySQL 版本进行升级,现在已已弃用,并且每当使用时都会发出警告。您应该期望在 MySQL 的未来版本中删除此选项;依赖此选项的应用程序应尽快开始迁移。--character-set-client-handshake option.  The --character-set-client-handshake server option, originally intended for use with upgrades from very old versions of MySQL, is now deprecated and a warning is issued whenever it is used. You should expect this option to be removed in a future version of MySQL; applications depending on this option should begin migration away from it as soon as possible.

  • 非标准外键。 使用非唯一或部分键作为外键是非标准的,并且在 MySQL 中已弃用。从 MySQL 8.4.0 开始,您必须通过将 restrict_fk_on_non_standard_key 设置为 OFF 或使用 --skip-restrict-fk-on-non-standard-key.Nonstandard foreign keys.  The use of non-unique or partial keys as foreign keys is nonstandard, and is deprecated in MySQL. Beginning with MySQL 8.4.0, you must explicitly enable such keys by setting restrict_fk_on_non_standard_key to OFF, or by starting the server with --skip-restrict-fk-on-non-standard-key.

    restrict_fk_on_non_standard_key 默认情况下为 ON,这意味着尝试在 CREATE TABLE 或其他 SQL 语句中使用非标准键作为外键会被 ER_WARN_DEPRECATED_NON_STANDARD_KEY。将其设置为 ON 允许运行此类语句,但它们会引发与警告相同的错误。restrict_fk_on_non_standard_key is ON by default, which means that trying to use a nonstandard key as a foreign key in a CREATE TABLE or other SQL statement is rejected with ER_WARN_DEPRECATED_NON_STANDARD_KEY. Setting it to ON allows such statements to run, but they raise the same error as a warning.

    即使存在包含引用非唯一或部分键的外键的表,也支持从 MySQL 8.0 升级。在这种情况下,服务器会写入一个警告消息列表,其中包含引用非标准键的任何外键的名称。Upgrades from MySQL 8.0 are supported even if there are tables containing foreign keys referring to non-unique or partial keys. In such cases, the server writes a list of warning messages containing the names of any foreign keys which refer to nonstandard keys.

MySQL 8.4 中删除的功能Features Removed in MySQL 8.4

以下项目已过时并已在 MySQL 8.4 中删除。如果显示替代方案,则应更新应用程序以使用它们。The following items are obsolete and have been removed in MySQL 8.4. Where alternatives are shown, applications should be updated to use them.

对于使用 MySQL 8.4 中删除的功能的 MySQL 8.3 应用程序,从 MySQL 8.3 源复制到 MySQL 8.4 副本时,语句可能会失败,或者可能对源和副本产生不同的影响。为了避免此类问题,应修改使用 MySQL 8.4 中删除的功能的应用程序以避免这些问题,并尽可能使用替代方案。For MySQL 8.3 applications that use features removed in MySQL 8.4, statements may fail when replicated from a MySQL 8.3 source to a MySQL 8.4 replica, or may have different effects on source and replica. To avoid such problems, applications that use features removed in MySQL 8.4 should be revised to avoid them and use alternatives when possible.

  • 服务器选项和变量已删除。 MySQL 8.4 中删除了以前版本 MySQL 中支持的许多服务器选项和变量。尝试在 MySQL 8.4 中设置其中任何一个都会引发错误。这些选项和变量列于此处:Server options and variables removed.  A number of server options and variables supported in previous versions of MySQL have been removed in MySQL 8.4. Attempting to set any of them in MySQL 8.4 raises an error. These options and variables are listed here:

    • binlog_transaction_dependency_tracking:在 MySQL 8.0.35 和 MySQL 8.2.0 中已弃用。没有计划替换此变量或其功能,该变量已内置于服务器内部。在 MySQL 8.4(及更高版本)中,当使用多线程副本时,源 mysqld 使用始终写入集来生成二进制日志的依赖信息;这与在以前版本的 MySQL 中将 binlog_transaction_dependency_tracking 设置为 WRITESET 具有相同的效果。binlog_transaction_dependency_tracking: Deprecated in MySQL 8.0.35 and MySQL 8.2.0. There are no plans to replace this variable or its functionality, which has been made internal to the server. In MySQL 8.4 (and later), when multithreaded replicas are in use, the source mysqld uses always writesets to generate dependency information for the binary log; this has the same effect as setting binlog_transaction_dependency_tracking to WRITESET in previous versions of MySQL.

    • group_replication_recovery_complete_at:在 MySQL 8.0.34 中已弃用。在 MySQL 8.4 及更高版本中,分布式恢复过程中应用的策略始终是仅在新成员接收、认证并应用其加入组之前发生的所有事务后才将其标记为在线;这相当于在以前版本的 MySQL 中将 group_replication_recovery_complete_at 设置为 TRANSACTIONS_APPLIED。group_replication_recovery_complete_at: Deprecated in MySQL 8.0.34. In MySQL 8.4 and later, the policy applied during the distributed recovery process is always to mark a new member online only after it has received, certified, and applied all transactions that took place before it joined the group; this is equivalent to setting group_replication_recovery_complete_at to TRANSACTIONS_APPLIED in previous versions of MySQL.

    • avoid_temporal_upgrade 和 show_old_temporals:这两个变量在 MySQL 5.6 中已弃用;它们对 MySQL 的最新版本都没有任何影响。两个变量都已被删除;没有计划替换其中任何一个。avoid_temporal_upgrade and show_old_temporals: Both of these variables were deprecated in MySQL 5.6; neither of them had any effect in recent versions of MySQL. Both variables have been removed; there are no plans to replace either of them.

    • --no-dd-upgrade:在 MySQL 8.0.16 中已弃用,现已删除。请改用 --upgrade=NONE。--no-dd-upgrade: Deprecated in MySQL 8.0.16, now removed. Use --upgrade=NONE instead.

    • --old 和 --new:两者在 MySQL 8.0.35 和 MySQL 8.2.0 中已弃用,现已删除。--old and --new: Both deprecated in MySQL 8.0.35 and MySQL 8.2.0, and now removed.

    • --language:在 MySQL 5.5 中已弃用,现已删除。--language: Deprecated in MySQL 5.5, and now removed.

    • --ssl 和 --admin-ssl 服务器选项,以及 have_ssl 和 have_openssl 服务器系统变量,在 MySQL 中已弃用 8.0.26。它们都在此版本中被删除。请改用 --tls-version 和 --admin-tls-version。The --ssl and --admin-ssl server options, as well as the have_ssl and have_openssl server system variables, were deprecated in MySQL 8.0.26. They are all removed in this release. Use --tls-version and --admin-tls-version instead.

    • default_authentication_plugin 系统变量在 MySQL 8.0.27 中已弃用,从 MySQL 8.4.0 起已删除。请改用 authentication_policy。The default_authentication_plugin system variable, deprecated in MySQL 8.0.27, is removed as of MySQL 8.4.0. Use authentication_policy instead.

      作为删除 default_authentication_plugin 的一部分,authentication_policy 的语法已更改。有关详细信息,请参阅 authentication_policy 的说明。As part of the removal of default_authentication_plugin, the syntax for authentication_policy has been changed. See the description of authentication_policy for more information.

    • --skip-host-cache 服务器选项。 该选项已被删除;使用 --host-cache-size=0 启动服务器。请参阅第 7.1.12.3 节“DNS 查找和主机缓存”。--skip-host-cache server option.  This option has been removed; start the server with --host-cache-size=0 instead. See Section 7.1.12.3, “DNS Lookups and the Host Cache”.

    • --innodb 和 --skip-innodb 服务器选项。 这些选项已被删除。 InnoDB 存储引擎始终处于启用状态,并且无法禁用它。--innodb and --skip-innodb server options.  These options have been removed. The InnoDB storage engine is always enabled, and it is not possible to disable it.

    • --character-set-client-handshake 和 --old-style-user-limits 服务器选项。 这些选项以前用于与非常旧的 MySQL 版本兼容,这些版本不再受支持或维护,因此不再有任何有用的用途。--character-set-client-handshake and --old-style-user-limits server options.  These options were formerly used for compatibility with very old versions of MySQL which are no longer supported or maintained, and thus no longer serve any useful purpose.

    • FLUSH HOSTS 语句。 MySQL 8.0.23 中已弃用的 FLUSH HOSTS 语句已被删除。要清除主机缓存,请发出 TRUNCATE TABLE performance_schema.host_cache或mysqladmin 刷新主机。FLUSH HOSTS statement.  The FLUSH HOSTS statement, deprecated in MySQL 8.0.23, has been removed. To clear the host cache, issue TRUNCATE TABLE performance_schema.host_cache or mysqladmin flush-hosts.

  • 过时的复制选项和变量。 与 MySQL 复制相关的许多选项和变量在以前的 MySQL 版本中已被弃用,并已从 MySQL 8.4 中删除。现在尝试使用其中任何一个都会导致服务器引发语法错误。这些选项和变量列于此处:Obsolete replication options and variables.  A number of options and variables relating to MySQL Replication were deprecated in previous versions of MySQL, and have been removed from MySQL 8.4. Attempting to use any of these now causes the server to raise a syntax error. These options and variables are listed here:

    • --slave-rows-search-algorithms:复制应用程序在应用更新或删除时用于查找表行的算法现在始终为 HASH_SCAN,INDEX_SCAN,并且用户不再可配置。--slave-rows-search-algorithms: The algorithm used by the replication applier to look up table rows when applying updates or deletes is now always HASH_SCAN,INDEX_SCAN, and is no longer configurable by the user.

    • log_bin_use_v1_events:这允许运行 MySQL 5.7 及更高版本的源服务器复制到不再支持或维护的早期版本的 MySQL。log_bin_use_v1_events: This allowed source servers running MySQL 5.7 and newer to replicate to earlier versions of MySQL which are no longer supported or maintained.

    • --relay-log-info-file、--relay-log-info-repository、--master-info-file、--master-info-repository:应用程序元数据存储库和连接元数据存储库的文件使用已被崩溃安全表取代,不再受支持。请参阅第 19.2.4.2 节“复制元数据存储库”。--relay-log-info-file, --relay-log-info-repository, --master-info-file, --master-info-repository: The use of files for the applier metadata repository and the connection metadata repository has been superseded by crash-safe tables, and is no longer supported. See Section 19.2.4.2, “Replication Metadata Repositories”.

    • transaction_write_set_extractiontransaction_write_set_extraction

    • group_replication_ip_whitelist:请改用 group_replication_ip_allowlist。group_replication_ip_whitelist: Use group_replication_ip_allowlist instead.

    • group_replication_primary_member:不再需要;请检查性能架构 replication_group_members 表的 MEMBER_ROLE 列。group_replication_primary_member: No longer needed; check the MEMBER_ROLE column of the Performance Schema replication_group_members table instead.

  • 复制 SQL 语法。 MySQL 复制中使用的许多 SQL 语句在早期版本的 MySQL 中已弃用,但在 MySQL 8.4 中不再受支持。现在尝试使用这些语句中的任何一个都会产生语法错误。这些语句可以分为两组,一组与源服务器相关,另一组与副本服务器相关,如下所示:Replication SQL syntax.  A number of SQL statements used in MySQL Replication which were deprecated in earlier versions of MySQL are no longer supported in MySQL 8.4. Attempting to use any of these statements now produces a syntax error. These statements can be divided into two groups those relating to source servers, and those referring to replicas, as shown here:

    作为这项工作的一部分,DISABLE ON SLAVE选项为CREATE EVENT以及ALTER EVENT现已被弃用,并由……取代DISABLE ON REPLICA相应的术语SLAVESIDE_DISABLED现在也已被弃用,不再用于事件描述中,例如在信息模式中EVENTS桌子;REPLICA_SIDE_DISABLED现在显示为。As part of this work, the DISABLE ON SLAVE option for CREATE EVENT and ALTER EVENT is now deprecated, and is superseded by DISABLE ON REPLICA. The corresponding term SLAVESIDE_DISABLED is also now deprecated,and no longer used in event descriptions such as in the Information Schema EVENTS table; REPLICA_SIDE_DISABLED is now shown instead.

    之前列出的所有语句均已从 MySQL 测试程序和文件以及任何其他内部使用中删除。All of the statements listed previously were removed from MySQL test programs and files, as well as from any other internal use.

    此外,CHANGE REPLICATION SOURCE TO 和 START REPLICA 已被删除,服务器不再接受。接下来列出了每个 SQL 语句的已删除选项。In addition, a number of deprecated options formerly supported by CHANGE REPLICATION SOURCE TO and START REPLICA have been removed and are no longer accepted by the server. The removed options for each of these SQL statements are listed next.

    此外,作为这项工作的一部分,以下先前已弃用的服务器状态变量已被删除。此处列出了它们及其替代项:Also as part of this work, the following server status variables, previously deprecated, have been removed. They are listed here, along with their replacements:

    • Com_slave_start:使用 Com_replica_start。Com_slave_start: Use Com_replica_start.

    • Com_slave_stop:使用 Com_replica_stop。Com_slave_stop: Use Com_replica_stop.

    • Com_show_slave_status:使用 Com_show_replica_status。Com_show_slave_status: Use Com_show_replica_status.

    • Com_show_slave_hosts:使用 Com_show_replicas。Com_show_slave_hosts: Use Com_show_replicas.

    • Com_show_master_status:使用 Com_show_binary_log_status。Com_show_master_status: Use Com_show_binary_log_status.

    • Com_change_master:使用 Com_change_replication_source。Com_change_master: Use Com_change_replication_source.

    刚刚列出的已删除变量不再出现在诸如 SHOW STATUS。另请参阅Com_xxx 变量。The variables just listed as removed no longer appear in the output of statements such as SHOW STATUS. See also Com_xxx Variables.

  • 插件。 MySQL 8.4.0 中删除了许多插件,此处列出了所有系统变量和与其相关的其他功能,这些变量和其他功能也已被删除或受到插件删除的影响:Plugins.  A number of plugins were removed in MySQL 8.4.0, and are listed here, along with any system variables and other features associated with them which were also removed or otherwise affected by the plugin removal:

  • 对弱密码的支持。 配置加密连接时,MySQL 8.4.0 及更高版本不再允许指定任何不满足以下要求的密码:Support for weak ciphers.  When configuring encrypted connections, MySQL 8.4.0 and later no longer allow specifying any cipher that does not meet the following requirements:

    • 符合正确的 TLS 版本(TLS v1.2 或 TLSv1.3,视情况而定)Conforms to proper TLS version (TLS v1.2 or TLSv1.3, as appropriate)

    • 提供完美的前向保密Provides perfect forward secrecy

    • 在密码、证书或两者中使用 SHA2Uses SHA2 in cipher, certificate, or both

    • 在 GCM 或任何其他中使用 AES AEAD 算法或模式Uses AES in GCM or any other AEAD algorithms or modes

    这对设置以下系统变量有影响:This has implications for setting the following system variables:

    请参阅这些变量的说明,了解 MySQL 8.4 中允许的值以及更多信息。See the descriptions of these variables for their permitted values in MySQL 8.4, and more information.

    Note

    libmysqlclient 继续支持不满足这些条件的其他密码,以便保留连接到旧版本 MySQL 的能力。libmysqlclient continues to support additional ciphers that do not satisfy these conditions in order to retain the ability to connect to older versions of MySQL.

  • INFORMATION_SCHEMA.TABLESPACES。 INFORMATION_SCHEMA.TABLESPACES 表并未实际使用,在 MySQL 8.0.22 中已弃用,现已删除。INFORMATION_SCHEMA.TABLESPACES.  The INFORMATION_SCHEMA.TABLESPACES table, which was not actually used, was deprecated in MySQL 8.0.22 and has now been removed.

    Note

    对于 NDB 表,信息架构 FILES 表提供表空间相关信息。For NDB tables, the Information Schema FILES table provides tablespace-related information.

    对于 InnoDB 表,信息架构 INNODB_TABLESPACES 和 INNODB_DATAFILES 表提供表空间元数据。For InnoDB tables, the Information Schema INNODB_TABLESPACES and INNODB_DATAFILES tables provide tablespace metadata.

  • DROP TABLESPACE 和 ALTER TABLESPACE: ENGINE 子句。 DROP TABLESPACE 和 ENGINE 语句在 MySQL 8.0 中已被弃用。在 MySQL 8.4 中,不再支持它,如果您尝试将其与 DROP TABLESPACE 或 ALTER TABLESPACE 一起使用,则会导致错误。 ALTER TABLESPACE 的所有其他变体也不再支持 ALTER TABLESPACE ... DROP DATAFILE,但此处列出了两个例外:DROP TABLESPACE and ALTER TABLESPACE: ENGINE clause.  The ENGINE clause for DROP TABLESPACE and ALTER TABLESPACE statements was deprecated in MySQL 8.0. In MySQL 8.4, it is no longer supported, and causes an error if you attempt to use it with DROP TABLESPACE or ALTER TABLESPACE ... DROP DATAFILE. ENGINE is also no longer supported for all other variants of ALTER TABLESPACE, with the two exceptions listed here:

    • ALTER TABLESPACE ... ADD DATAFILE ENGINE={NDB|NDBCLUSTER}ALTER TABLESPACE ... ADD DATAFILE ENGINE={NDB|NDBCLUSTER}

    • ALTER UNDO TABLESPACE ... SET {ACTIVE|INACTIVE} ENGINE=INNODBALTER UNDO TABLESPACE ... SET {ACTIVE|INACTIVE} ENGINE=INNODB

    有关详细信息,请参阅这些语句的文档。For more information, see the documentation for these statements.

  • LOW_PRIORITY 与 LOCK TABLES ... WRITE。 LOW_PRIORITY 语句的 LOCK TABLES ... WRITE 子句从 MySQL 5.5 起就没有任何作用,并且在 MySQL 5.6 中已弃用。 MySQL 8.4 不再支持;将其包含在 LOCK TABLES 中现在会导致语法错误。LOW_PRIORITY with LOCK TABLES ... WRITE.  The LOW_PRIORITY clause of the LOCK TABLES ... WRITE statement had had no effect since MySQL 5.5, and was deprecated in MySQL 5.6. It is no longer supported in MySQL 8.4; including it in LOCK TABLES now causes a syntax error.

  • EXPLAIN FORMAT=JSON 格式版本控制。 现在可以使用此版本中引入的 explain_json_format_version 服务器系统变量在 EXPLAIN FORMAT=JSON 语句使用的 2 个版本的 JSON 输出格式之间进行选择。将此变量设置为 1 会导致服务器使用版本 1,这是一种线性格式,始终用于 MySQL 8.2 及更早版本中此类语句的输出。这是 MySQL 8.4 中的默认值和格式。将 explain_json_format_version 设置为 2 会导致使用版本 2 格式;此 JSON 输出格式基于访问路径,旨在提供与未来版本的 MySQL 优化器更好的兼容性。EXPLAIN FORMAT=JSON format versioning.  It is now possible to choose between 2 versions of the JSON output format used by EXPLAIN FORMAT=JSON statements using the explain_json_format_version server system variable introduced in this release. Setting this variable to 1 causes the server to use Version 1, which is the linear format which was always used for output from such statements in MySQL 8.2 and earlier. This is the default value and format in MySQL 8.4. Setting explain_json_format_version to 2 causes the Version 2 format to be used; this JSON output format is based on access paths, and is intended to provide better compatibility with future versions of the MySQL Optimizer.

    有关详细信息和示例,请参阅获取执行计划信息。See Obtaining Execution Plan Information, for more information and examples.

  • 捕获 EXPLAIN FORMAT=JSON 输出。 EXPLAIN FORMAT=JSON 使用 INTO 选项进行了扩展,该选项提供了将 JSON 格式的 EXPLAIN 输出存储在用户变量中的能力,可以使用 MySQL JSON 函数对其进行处理,如下所示:Capturing EXPLAIN FORMAT=JSON output.  EXPLAIN FORMAT=JSON was extended with an INTO option, which provides the ability to store JSON-formatted EXPLAIN output in a user variable where it can be worked with using MySQL JSON functions, like this:

    mysql> EXPLAIN FORMAT=JSON INTO @myex SELECT name FROM a WHERE id = 2;
    Query OK, 0 rows affected (0.00 sec)
    
    mysql> SELECT JSON_EXTRACT(@myex, "$.query_block.table.key");
    +------------------------------------------------+
    | JSON_EXTRACT(@myex, "$.query_block.table.key") |
    +------------------------------------------------+
    | "PRIMARY"                                      |
    +------------------------------------------------+
    1 row in set (0.01 sec)
    

    仅当 EXPLAIN 语句也包含 FORMAT=JSON;否则,会产生语法错误。此要求不受 explain_format 值的影响。This option can be used only if the EXPLAIN statement also contains FORMAT=JSON; otherwise, a syntax error results. This requirement is not affected by the value of explain_format.

    INTO 可以与任何可解释语句一起使用,但 EXPLAIN FOR CONNECTION 除外。它不能与EXPLAIN ANALYZE一起使用。INTO can be used with any explainable statement with the exception of EXPLAIN FOR CONNECTION. It cannot be used with EXPLAIN ANALYZE.

    有关详细信息和示例,请参阅获取执行计划信息。For more information and examples, see Obtaining Execution Plan Information.

  • EXPLAIN FOR SCHEMA。 在 EXPLAIN 语句中添加了 FOR SCHEMA 选项。语法如下所示,其中 stmt 是一个可解释的语句:EXPLAIN FOR SCHEMA.  Added a FOR SCHEMA option to the EXPLAIN statement. The syntax is as shown here, where stmt is an explainable statement:

    EXPLAIN [options] FOR SCHEMA schema_name stmt
    

    这会导致 stmt 就像在命名架构中一样运行。This causes stmt to be run as if in the named schema.

    FOR DATABASE 也支持作为同义词。FOR DATABASE is also supported as a synonym.

    此选项与 FOR CONNECTION。This option is not compatible with FOR CONNECTION.

    有关详细信息,请参阅获取执行计划信息。See Obtaining Execution Plan Information, for more information.

  • 保留客户注释。 在 MySQL 8.0 中,从 mysql 客户端中剥离注释是默认行为;默认值已更改以保留此类注释。Client comments preserved.  In MySQL 8.0, the stripping of comments from the mysql client was the default behavior; the default was changed to preserve such comments.

    要启用像 MySQL 8.0 及更早版本中执行的注释剥离,请启动mysql客户与--skip-comments.To enable the stripping of comments as was performed in MySQL 8.0 and earlier, start the mysql client with --skip-comments.

  • AUTO_INCREMENT 和浮点列。的使用AUTO_INCREMENT带有修饰符FLOAT以及DOUBLE在列中CREATE TABLE以及ALTER TABLE在 MySQL 8.0 中,statements 已被弃用;在 MySQL 8.4 中,它完全不再受支持,并会引发ER_WRONG_FIELD_SPEC (列的列指定符不正确).AUTO_INCREMENT and floating-point columns.  The use of the AUTO_INCREMENT modifier with FLOAT and DOUBLE columns in CREATE TABLE and ALTER TABLE statements was deprecated in MySQL 8.0; support for it is removed altogether in MySQL 8.4, where it raises ER_WRONG_FIELD_SPEC (Incorrect column specifier for column).

    在从之前的系列升级到 MySQL 8.4 之前,您必须使用 FLOAT 修复任何包含 DOUBLE 或 AUTO_INCREMENT 列的表,以便表不再使用其中任何一个。否则,升级将失败。Before upgrading to MySQL 8.4 from a previous series, you must fix any table that contains a FLOAT or DOUBLE column with AUTO_INCREMENT so that the table no longer uses either of these. Otherwise, the upgrade fails .

  • mysql_ssl_rsa_setup 实用程序。 mysql_ssl_rsa_setup 实用程序已在 MySQL 8.0.34 中弃用,已被删除。对于使用 OpenSSL 编译的 MySQL 发行版,MySQL 服务器可以在启动时自动生成丢失的 SSL 和 RSA 文件。有关详细信息,请参阅第 8.3.3.1 节“使用 MySQL 创建 SSL 和 RSA 证书和密钥”。mysql_ssl_rsa_setup utility.  The mysql_ssl_rsa_setup utility, deprecated in MySQL 8.0.34, has been removed. For MySQL distributions compiled using OpenSSL, the MySQL server can perform automatic generation of missing SSL and RSA files at startup. See Section 8.3.3.1, “Creating SSL and RSA Certificates and Keys using MySQL”, for more information.

  • MySQL 权限。 添加了用于创建定义者对象的 SET_ANY_DEFINER 权限和 ALLOW_NONEXISTENT_DEFINER 孤儿对象保护权限。这些权限与已弃用的 SET_USER_ID 权限共存。MySQL Privileges.  Added the SET_ANY_DEFINER privilege for definer object creation and the ALLOW_NONEXISTENT_DEFINER privilege for orphan object protection. Together these privileges coexist with the deprecated SET_USER_ID privilege.

  • SET_USER_ID 权限。 MySQL 8.2.0 中已弃用的 SET_USER_ID 权限已被删除。在 GRANT 语句中使用现在会导致语法错误SET_USER_ID privilege.  The SET_USER_ID privilege, deprecated in MySQL 8.2.0, has been removed. use in GRANT statements now causes a syntax error

    您可以使用 SET_ANY_DEFINER 权限来创建定义者对象,而不是 SET_USER_ID,并且使用 ALLOW_NONEXISTENT_DEFINER 孤立对象保护权限。Instead of SET_USER_ID, you can use the SET_ANY_DEFINER privilege for definer object creation, and the ALLOW_NONEXISTENT_DEFINER privileges for orphan object protection.

    使用 CREATE PROCEDURE、CREATE FUNCTION、CREATE TRIGGER、CREATE EVENT 或 CREATE VIEW。Both privileges are required to produce orphaned SQL objects using CREATE PROCEDURE, CREATE FUNCTION, CREATE TRIGGER, CREATE EVENT, or CREATE VIEW.

  • --abort-slave-event-count 和--disconnect-slave-event-count 服务器选项。 MySQL 服务器启动选项 --abort-slave-event-count 和 --disconnect-slave-event-count 以前用于测试,在 MySQL 8.0 中已弃用,并已在本版本中删除。尝试使用这些选项之一启动 mysqld 现在会导致错误。--abort-slave-event-count and --disconnect-slave-event-count server options.  The MySQL server startup options --abort-slave-event-count and --disconnect-slave-event-count, formerly used in testing, were deprecated in MySQL 8.0, and have been removed in this release. Attempting to start mysqld with either of these options now results in an error.

  • mysql_upgrade 实用程序。 mysql_upgrade 实用程序已在 MySQL 8.0.16 中弃用,已被删除。mysql_upgrade utility.  The mysql_upgrade utility, deprecated in MySQL 8.0.16, has been removed.

  • mysqlpump 实用程序。 mysqlpump 实用程序及其辅助实用程序 lz4_decompress 和 zlib_decompress(在 MySQL 8.0.34 中已弃用)已被删除。相反,请使用 mysqldump 或 MySQL Shell 的转储实用程序。mysqlpump utility.  The mysqlpump utility along with its helper utilities lz4_decompress and zlib_decompress, deprecated in MySQL 8.0.34, were removed. Instead, use mysqldump or MySQL Shell's dump utilities.

  • 过时的 CMake 选项。 以下用于使用 CMake 编译服务器的选项已过时并已被删除:Obsolete CMake options.  The following options for compiling the server with CMake were obsolete and have been removed:

    • USE_LD_LLD:使用 WITH_LD=lld 代替。USE_LD_LLD: Use WITH_LD=lld instead.

    • WITH_BOOST, DOWNLOAD_BOOST、DOWNLOAD_BOOST_TIMEOUT:这些选项不再需要; MySQL 现在在从源代码编译时包含并使用捆绑版本的 Boost。WITH_BOOST, DOWNLOAD_BOOST, DOWNLOAD_BOOST_TIMEOUT: These options are no longer necessary; MySQL now includes and uses a bundled version of Boost when compiling from source.

  • 删除了关键字。 自 MySQL 8.0 以来,MySQL 8.4 中删除了关键字。保留关键字标有 (R)。Removed Keywords.  Keywords removed in MySQL 8.4 since MySQL 8.0. Reserved keywords are marked with (R).

    GET_MASTER_PUBLIC_KEY、MASTER_AUTO_POSITION、MASTER_BIND (R)、MASTER_COMPRESSION_ALGORITHMS、MASTER_CONNECT_RETRY、MASTER_DELAY、MASTER_HEARTBEAT_PERIOD、MASTER_HOST、MASTER_LOG_FILE、MASTER_LOG_POS、MASTER_PASSWORD、MASTER_PORT、 MASTER_PUBLIC_KEY_PATH、MASTER_RETRY_COUNT、MASTER_SSL、MASTER_SSL_CA、MASTER_SSL_CAPATH、MASTER_SSL_CERT、MASTER_SSL_CIPHER、MASTER_SSL_CRL、MASTER_SSL_CRLPATH、MASTER_SSL_KEY、MASTER_SSL_VERIFY_SERVER_CERT (R)、MASTER_TLS_CIPHERSUITES、MASTER_TLS_VERSION、MASTER_USER 和 MASTER_ZSTD_COMPRESSION_LEVEL。GET_MASTER_PUBLIC_KEY, MASTER_AUTO_POSITION, MASTER_BIND (R), MASTER_COMPRESSION_ALGORITHMS, MASTER_CONNECT_RETRY, MASTER_DELAY, MASTER_HEARTBEAT_PERIOD, MASTER_HOST, MASTER_LOG_FILE, MASTER_LOG_POS, MASTER_PASSWORD, MASTER_PORT, MASTER_PUBLIC_KEY_PATH, MASTER_RETRY_COUNT, MASTER_SSL, MASTER_SSL_CA, MASTER_SSL_CAPATH, MASTER_SSL_CERT, MASTER_SSL_CIPHER, MASTER_SSL_CRL, MASTER_SSL_CRLPATH, MASTER_SSL_KEY, MASTER_SSL_VERIFY_SERVER_CERT (R), MASTER_TLS_CIPHERSUITES, MASTER_TLS_VERSION, MASTER_USER, and MASTER_ZSTD_COMPRESSION_LEVEL.

  • 分区键中的索引前缀。 MySQL 8.0 中分区表的分区键中允许使用带有索引前缀的列,并且在创建、更改或升级分区表时会发出警告,但不会产生任何其他影响。分区表中不再允许此类列,并且在分区键中使用任何此类列会导致 CREATE TABLE 或 ALTER TABLE 语句被拒绝并出现错误。Index prefixes in partitioning key.  Columns with index prefixes were allowed in the partitioning key for a partitioned table in MySQL 8.0, and raised a warning with no other effects when creating, altering, or upgrading a partitioned table. Such columns are no longer permitted in partitioned tables, and using any such columns in the partitioning key causes the CREATE TABLE or ALTER TABLE statement in they occur to be rejected with an error.

    有关详细信息,请参阅键分区不支持列索引前缀。For more information, see Column index prefixes not supported for key partitioning.