There are two approaches for upgrading MySQL on Windows:在Windows上升级MySQL有两种方法:
The approach you select depends on how the existing installation was performed. Before proceeding, review Section 2.11, “Upgrading MySQL” for additional information on upgrading MySQL that is not specific to Windows.您选择的方法取决于现有安装的执行方式。继续之前,请参阅第2.11节,“升级MySQL”,了解有关升级MySQL的其他信息,这些信息不是Windows特有的。
Whichever approach you choose, always back up your current MySQL installation before performing an upgrade. See Section 7.2, “Database Backup Methods”.无论您选择哪种方法,在执行升级之前,请始终备份您当前的MySQL安装。请参阅第7.2节,“数据库备份方法”。
Upgrades between non-GA releases (or from a non-GA release to a GA release) are not supported. Significant development changes take place in non-GA releases and you may encounter compatibility issues or problems starting the server.不支持在非GA版本之间升级(或从非GA版本升级到GA版本)。在非GA版本中会发生重大的开发更改,您可能会遇到兼容性问题或启动服务器的问题。
MySQL Installer does not support upgrades between Community releases and Commercial releases. MySQL安装程序不支持社区版本和商业版本之间的升级。If you require this type of upgrade, perform it using the ZIP archive approach.如果您需要这种类型的升级,请使用ZIP归档方法执行。
Performing an upgrade with MySQL Installer is the best approach when the current server installation was performed with it and the upgrade is within the current release series. MySQL Installer does not support upgrades between release series, such as from 5.7 to 8.0, and it does not provide an upgrade indicator to prompt you to upgrade. 当使用MySQL安装程序执行当前服务器安装并且升级在当前版本系列中时,使用MySQL安装软件执行升级是最好的方法。MySQL安装程序不支持版本系列之间的升级,例如从5.7到8.0,也不提供升级指示器来提示您升级。For instructions on upgrading between release series, see Upgrading MySQL Using the Windows ZIP Distribution.有关在版本系列之间升级的说明,请参阅使用Windows ZIP Distribution升级MySQL。
To perform an upgrade using MySQL Installer:要使用MySQL安装程序执行升级,请执行以下操作:
Start MySQL Installer.启动MySQL安装程序。
From the dashboard, click Catalog to download the latest changes to the catalog. The installed server can be upgraded only if the dashboard displays an arrow next to the version number of the server.
Click Upgrade. All products that have a newer version now appear in a list.
MySQL Installer deselects the server upgrade option for milestone releases (Pre-Release) in the same release series. In addition, it displays a warning to indicate that the upgrade is not supported, identifies the risks of continuing, and provides a summary of the steps to perform an upgrade manually. You can reselect server upgrade and proceed at your own risk.
Deselect all but the MySQL server product, unless you intend to upgrade other products at this time, and click
.Click
to start the download. When the download finishes, click to begin the upgrade operation.Upgrades to MySQL 8.0.16 and higher may show an option to skip the upgrade check and process for system tables. For more information about this option, see Important server upgrade conditions.
Configure the server.
To perform an upgrade using the Windows ZIP archive distribution:
Download the latest Windows ZIP Archive distribution of MySQL from https://dev.mysql.com/downloads/.
If the server is running, stop it. If the server is installed as a service, stop the service with the following command from the command prompt:
C:\> SC STOP mysqld_service_name
Alternatively, use NET STOP mysqld_service_name
.
If you are not running the MySQL server as a service, use mysqladmin to stop it. For example, before upgrading from MySQL 5.7 to 8.0, use mysqladmin from MySQL 5.7 as follows:
C:\> "C:\Program Files\MySQL\MySQL Server 5.7\bin\mysqladmin" -u root shutdown
If the MySQL root
user account has a password, invoke mysqladmin with the -p
option and enter the password when prompted.
Extract the ZIP archive. You may either overwrite your existing MySQL installation (usually located at C:\mysql
), or install it into a different directory, such as C:\mysql8
. Overwriting the existing installation is recommended.
Restart the server. For example, use the SC START mysqld_service_name
or NET START mysqld_service_name
command if you run MySQL as a service, or invoke mysqld directly otherwise.
Prior to MySQL 8.0.16, run mysql_upgrade as Administrator to check your tables, attempt to repair them if necessary, and update your grant tables if they have changed so that you can take advantage of any new capabilities. See Section 4.4.5, “mysql_upgrade — Check and Upgrade MySQL Tables”. As of MySQL 8.0.16, this step is not required, as the server performs all tasks previously handled by mysql_upgrade.
If you encounter errors, see Section 2.3.5, “Troubleshooting a Microsoft Windows MySQL Server Installation”.