2.3 Installing MySQL on Microsoft Windows在Microsoft Windows上安装MySQL

2.3.1 MySQL Installation Layout on Microsoft WindowsMicrosoft Windows上的MySQL安装布局
2.3.2 Choosing an Installation Package选择安装包
2.3.3 MySQL Installer for Windows适用于Windows的MySQL安装程序
2.3.4 Installing MySQL on Microsoft Windows Using a noinstall ZIP Archive使用noinstall ZIP存档在Microsoft Windows上安装MySQL
2.3.5 Troubleshooting a Microsoft Windows MySQL Server InstallationMicrosoft Windows MySQL服务器安装故障排除
2.3.6 Windows Postinstallation ProceduresWindows安装后过程
2.3.7 Windows Platform RestrictionsWindows平台限制
Important重要

MySQL 8.0 Server requires the Microsoft Visual C++ 2015 Redistributable Package to run on Windows platforms. MySQL 8服务器需要微软Visual C++ 2015可重分发包在Windows平台上运行。Users should make sure the package has been installed on the system before installing the server. 在安装服务器之前,用户应确保软件包已安装在系统上。The package is available at the Microsoft Download Center. 该软件包可在Microsoft下载中心获得。Additionally, MySQL debug binaries require Visual Studio 2015 to be installed.此外,MySQL调试二进制文件需要安装Visual Studio 2015。

MySQL is available for Microsoft Windows 64-bit operating systems only. MySQL仅适用于Microsoft Windows 64位操作系统。For supported Windows platform information, see https://www.mysql.com/support/supportedplatforms/database.html.有关支持的Windows平台信息,请参阅https://www.mysql.com/support/supportedplatforms/database.html.

There are different methods to install MySQL on Microsoft Windows.在Microsoft Windows上安装MySQL有不同的方法。

MySQL Installer MethodMySQL安装程序方法

The simplest and recommended method is to download MySQL Installer (for Windows) and let it install and configure a specific version of MySQL Server as follows:最简单且推荐的方法是下载MySQL安装程序(适用于Windows),让它安装并配置特定版本的MySQL服务器,如下所示:

  1. Download MySQL Installer from https://dev.mysql.com/downloads/installer/ and execute it.从下载MySQL安装程序https://dev.mysql.com/downloads/installer/ 并执行它。

    Note注意

    Unlike the standard MySQL Installer, the smaller web-community version does not bundle any MySQL applications, but downloads only the MySQL products you choose to install.与标准MySQL安装程序不同,较小的web社区版本不捆绑任何MySQL应用程序,只下载您选择安装的MySQL产品。

  2. Determine the setup type to use for the initial installation of MySQL products. 确定初始安装MySQL产品时使用的安装类型。For example:例如:

    • Developer Default开发人员默认值: Provides a setup type that includes the selected version of MySQL Server and other MySQL tools related to MySQL development, such as MySQL Workbench.:提供一个安装类型,其中包括选定版本的MySQL服务器和其他与MySQL开发相关的MySQL工具,如MySQL Workbench。

    • Server Only仅服务器: Provides a setup for the selected version of MySQL Server without other products.:为所选版本的MySQL服务器提供安装程序,无需其他产品。

    • Custom自定义: Enables you to select any version of MySQL Server and other MySQL products.:允许您选择MySQL服务器和其他MySQL产品的任何版本。

  3. Install the server instance (and products) and then begin the server configuration by following the onscreen instructions. 安装服务器实例(和产品),然后按照屏幕上的说明开始服务器配置。For more information about each individual step, see Section 2.3.3.3.1, “MySQL Server Configuration with MySQL Installer”.有关每个步骤的更多信息,请参阅第2.3.3.3.1节,“使用MySQL安装程序配置MySQL服务器”

MySQL is now installed. MySQL现在已经安装。If you configured MySQL as a service, then Windows automatically starts the MySQL server every time you restart the system. 如果将MySQL配置为服务,则Windows会在每次重新启动系统时自动启动MySQL服务器。Also, this process installs the MySQL Installer application on the local host, which you can use later to upgrade or reconfigure MySQL server.此外,此过程在本地主机上安装MySQL安装程序应用程序,您可以稍后使用该应用程序升级或重新配置MySQL服务器。

Note注意

If you installed MySQL Workbench on your system, consider using it to check your new MySQL server connection. 如果在系统上安装MySQL Workbench,请考虑使用它来检查新的MySQL服务器连接。By default, the program automatically start after installing MySQL.默认情况下,程序在安装MySQL后自动启动。

Additional Installation Information其他安装信息

It is possible to run MySQL as a standard application or as a Windows service. 可以将MySQL作为标准应用程序或Windows服务运行。By using a service, you can monitor and control the operation of the server through the standard Windows service management tools. 通过使用服务,您可以通过标准Windows服务管理工具监视和控一致性务器的操作。For more information, see Section 2.3.4.8, “Starting MySQL as a Windows Service”.有关更多信息,请参阅第2.3.4.8节,“将MySQL作为Windows服务启动”

To accommodate the RESTART statement, the MySQL server forks when run as a service or standalone, to enable a monitor process to supervise the server process. 为了适应RESTART语句,MySQL服务器在作为服务或独立运行时进行分叉,以使监视进程能够监视服务器进程。In this case, there are two mysqld processes. 在本例中,有两个mysqld进程。If RESTART capability is not required, the server can be started with the --no-monitor option. 如果不需要RESTART功能,则可以使用--no-monitor选项启动服务器。See Section 13.7.8.8, “RESTART Statement”.请参阅第13.7.8.8节,“RESTART语句”

Generally, you should install MySQL on Windows using an account that has administrator rights. 通常,您应该使用具有管理员权限的帐户在Windows上安装MySQL。Otherwise, you may encounter problems with certain operations such as editing the PATH environment variable or accessing the Service Control Manager. 否则,您可能会在某些操作中遇到问题,例如编辑PATH环境变量或访问服务控制管理器When installed, MySQL does not need to be executed using a user with Administrator privileges.安装后,不需要使用具有管理员权限的用户来执行MySQL。

For a list of limitations on the use of MySQL on the Windows platform, see Section 2.3.7, “Windows Platform Restrictions”.有关在Windows平台上使用MySQL的限制列表,请参阅第2.3.7节,“Windows平台限制”

In addition to the MySQL Server package, you may need or want additional components to use MySQL with your application or development environment. 除了MySQL服务器包之外,您可能还需要或想要其他组件在应用程序或开发环境中使用MySQL。These include, but are not limited to:这些包括但不限于:

MySQL distributions for Windows can be downloaded from https://dev.mysql.com/downloads/. 适用于Windows的MySQL发行版可以从https://dev.mysql.com/downloads/下载。See Section 2.1.3, “How to Get MySQL”. 请参阅第2.1.3节,“如何获取MySQL”

MySQL for Windows is available in several distribution formats, detailed here. MySQL for Windows有几种分发格式,详细信息如下。Generally speaking, you should use MySQL Installer. 一般来说,您应该使用MySQL安装程序。It contains more features and MySQL products than the older MSI, is simpler to use than the compressed file, and you need no additional tools to get MySQL up and running. 它比旧的MSI包含更多的功能和MySQL产品,比压缩文件更易于使用,并且您不需要额外的工具来启动和运行MySQL。MySQL Installer automatically installs MySQL Server and additional MySQL products, creates an options file, starts the server, and enables you to create default user accounts. MySQL安装程序自动安装MySQL服务器和其他MySQL产品,创建选项文件,启动服务器,并允许您创建默认用户帐户。For more information on choosing a package, see Section 2.3.2, “Choosing an Installation Package”.有关选择软件包的更多信息,请参阅第2.3.2节,“选择安装软件包”

MySQL on Windows Considerations基于Windows的MySQL注意事项

2.3.1 MySQL Installation Layout on Microsoft Windows
2.3.2 Choosing an Installation Package
2.3.3 MySQL Installer for Windows
2.3.4 Installing MySQL on Microsoft Windows Using a
2.3.5 Troubleshooting a Microsoft Windows MySQL Server Installation
2.3.6 Windows Postinstallation Procedures
2.3.7 Windows Platform Restrictions