升级前请查看本节中的信息。执行任何建议的操作。Review the information in this section before upgrading. Perform any recommended actions.
了解升级过程中可能发生的情况。请参阅第 3.4 节“MySQL 升级过程升级的内容”。Understand what may occur during an upgrade. See Section 3.4, “What the MySQL Upgrade Process Upgrades”.
通过创建备份来保护您的数据。备份应包括
mysql系统数据库,其中包含 MySQL 数据字典表和系统表。请参阅第 9.2 节“数据库备份方法”。Protect your data by creating a backup. The backup should include themysqlsystem database, which contains the MySQL data dictionary tables and system tables. See Section 9.2, “Database Backup Methods”.Important不支持从 MySQL 8.4 降级到 MySQL 8.3,或从 MySQL 8.4 版本降级到以前的 MySQL 8.4 版本。唯一受支持的替代方案是恢复升级之前进行的备份。因此,您必须在开始升级过程之前备份数据。Downgrade from MySQL 8.4 to MySQL 8.3, or from a MySQL 8.4 release to a previous MySQL 8.4 release, is not supported. The only supported alternative is to restore a backup taken before upgrading. It is therefore imperative that you back up your data before starting the upgrade process.
查看第 3.2 节“升级路径”,以确保支持您的预期升级路径。Review Section 3.2, “Upgrade Paths” to ensure that your intended upgrade path is supported.
查看第 3.5 节“MySQL 8.4 中的更改”,了解升级前应注意的更改。某些更改可能需要采取措施。Review Section 3.5, “Changes in MySQL 8.4” for changes that you should be aware of before upgrading. Some changes may require action.
查看第 1.4 节“自 MySQL 8.0 以来 MySQL 8.4 中的新增功能”,了解已弃用和删除的功能。如果您使用其中任何功能,升级可能需要对这些功能进行更改。Review Section 1.4, “What Is New in MySQL 8.4 since MySQL 8.0” for deprecated and removed features. An upgrade may require changes with respect to those features if you use any of them.
查看第 1.5 节“自 MySQL 8.4 以来添加、弃用或删除的服务器和状态变量和选项” 8.0”。如果您使用已弃用或已删除的变量,则升级可能需要更改配置。Review Section 1.5, “Server and Status Variables and Options Added, Deprecated, or Removed in MySQL 8.4 since 8.0”. If you use deprecated or removed variables, an upgrade may require configuration changes.
查看发行说明,了解有关修复、更改和新功能的信息。Review the Release Notes for information about fixes, changes, and new features.
如果您使用复制,请查看 第 19.5.3 节,“升级或降级复制拓扑”。If you use replication, review Section 19.5.3, “Upgrading or Downgrading a Replication Topology”.
请查看 第 3.3 节,“升级最佳实践” 并相应地进行计划。Review Section 3.3, “Upgrade Best Practices” and plan accordingly.
升级程序因平台及初始安装方式而异。请使用适用于您当前 MySQL 安装的程序:Upgrade procedures vary by platform and how the initial installation was performed. Use the procedure that applies to your current MySQL installation:
对于非 Windows 平台上的二进制和基于软件包的安装,请参阅 第 3.7 节,“在 Unix/Linux 上升级 MySQL 二进制或基于软件包的安装”。For binary and package-based installations on non-Windows platforms, refer to Section 3.7, “Upgrading MySQL Binary or Package-based Installations on Unix/Linux”.
Note对于受支持的 Linux 发行版,升级基于软件包的安装的首选方法是使用 MySQL 软件仓库(MySQL Yum 仓库、MySQL APT 仓库和 MySQL SLES 仓库)。For supported Linux distributions, the preferred method for upgrading package-based installations is to use the MySQL software repositories (MySQL Yum Repository, MySQL APT Repository, and MySQL SLES Repository).
对于在企业 Linux 平台或 Fedora 上使用 MySQL Yum 仓库的安装,请参阅 第 3.8 节,“使用 MySQL Yum 仓库升级 MySQL”。For installations on an Enterprise Linux platform or Fedora using the MySQL Yum Repository, refer to Section 3.8, “Upgrading MySQL with the MySQL Yum Repository”.
对于使用 MySQL APT 仓库在 Ubuntu 上进行的安装,请参阅 第 3.9 节,“使用 MySQL APT 仓库升级 MySQL”。For installations on Ubuntu using the MySQL APT repository, refer to Section 3.9, “Upgrading MySQL with the MySQL APT Repository”.
对于使用 MySQL SLES 仓库在 SLES 上进行的安装,请参阅 第 3.10 节,“使用 MySQL SLES 仓库升级 MySQL”。For installations on SLES using the MySQL SLES repository, refer to Section 3.10, “Upgrading MySQL with the MySQL SLES Repository”.
对于使用 Docker 进行的安装,请参阅 第 3.12 节,“升级 MySQL Docker 安装”。For installations performed using Docker, refer to Section 3.12, “Upgrading a Docker Installation of MySQL”.
有关在 Windows 上的安装,请参阅 第 3.11 节,“在 Windows 上升级 MySQL”。For installations on Windows, refer to Section 3.11, “Upgrading MySQL on Windows”.
如果您的 MySQL 安装包含大量数据,在原地升级后转换可能需要很长时间,创建一个测试实例以评估所需转换和执行这些工作的步骤可能会很有用。要创建测试实例,请复制包含
mysql数据库和其他数据库(不含数据)的 MySQL 实例。在测试实例上运行升级程序,以评估执行实际数据转换所需的工作量。If your MySQL installation contains a large amount of data that might take a long time to convert after an in-place upgrade, it may be useful to create a test instance for assessing the conversions that are required and the work involved to perform them. To create a test instance, make a copy of your MySQL instance that contains themysqldatabase and other databases without the data. Run the upgrade procedure on the test instance to assess the work involved to perform the actual data conversion.在安装或升级到新的 MySQL 版本时,建议重建和重新安装 MySQL 语言接口。这适用于 MySQL 接口,例如 PHP
mysql扩展和 PerlDBD::mysql模块。Rebuilding and reinstalling MySQL language interfaces is recommended when you install or upgrade to a new release of MySQL. This applies to MySQL interfaces such as PHPmysqlextensions and the PerlDBD::mysqlmodule.