- 2.1 一般安装指南2.1 General Installation Guidance
- 2.1.1 支持的平台2.1.1 Supported Platforms
- 2.1.2 要安装哪个 MySQL 版本和发行版2.1.2 Which MySQL Version and Distribution to Install
- 2.1.3 如何获取 MySQL2.1.3 How to Get MySQL
- 2.1.4 使用 MD5 校验和或 GnuPG 验证包完整性2.1.4 Verifying Package Integrity Using MD5 Checksums or GnuPG
- 2.1.5 安装布局2.1.5 Installation Layouts
- 2.1.6 编译器特定的构建特征2.1.6 Compiler-Specific Build Characteristics
- 2.2 使用通用二进制文件在 Unix/Linux 上安装 MySQL2.2 Installing MySQL on Unix/Linux Using Generic Binaries
- 2.3 在 Microsoft Windows 上安装 MySQL2.3 Installing MySQL on Microsoft Windows
- 2.3.1 选择安装包2.3.1 Choosing an Installation Package
- 2.3.2 配置:使用 MySQL 配置器2.3.2 Configuration: Using MySQL Configurator
- 2.3.3 配置:手动2.3.3 Configuration: Manually
- 2.3.4 故障排除 Microsoft Windows MySQL Server 安装2.3.4 Troubleshooting a Microsoft Windows MySQL Server Installation
- 2.3.5 Windows 安装后过程2.3.5 Windows Postinstallation Procedures
- 2.3.6 Windows 平台限制2.3.6 Windows Platform Restrictions
- 2.4 在 macOS 上安装 MySQL2.4 Installing MySQL on macOS
- 2.4.1 在 macOS 上安装 MySQL 的一般注意事项2.4.1 General Notes on Installing MySQL on macOS
- 2.4.2 使用本机在 macOS 上安装 MySQL 软件包2.4.2 Installing MySQL on macOS Using Native Packages
- 2.4.3 安装和使用 MySQL 启动守护程序2.4.3 Installing and Using the MySQL Launch Daemon
- 2.4.4 安装和使用 MySQL 首选项窗格2.4.4 Installing and Using the MySQL Preference Pane
- 2.5 在 Linux 上安装 MySQL2.5 Installing MySQL on Linux
- 2.5.1 使用 MySQL Yum 存储库在 Linux 上安装 MySQL2.5.1 Installing MySQL on Linux Using the MySQL Yum Repository
- 2.5.2 使用 MySQL APT 存储库在 Linux 上安装 MySQL2.5.2 Installing MySQL on Linux Using the MySQL APT Repository
- 2.5.3 使用 MySQL SLES 存储库2.5.3 Using the MySQL SLES Repository
- 2.5.4 使用 Oracle 提供的 RPM 软件包在 Linux 上安装 MySQL2.5.4 Installing MySQL on Linux Using RPM Packages from Oracle
- 2.5.5 使用 Oracle 提供的 Debian 软件包在 Linux 上安装 MySQL2.5.5 Installing MySQL on Linux Using Debian Packages from Oracle
- 2.5.6 使用 Docker 容器在 Linux 上部署 MySQL2.5.6 Deploying MySQL on Linux with Docker Containers
- 2.5.7 从本机软件存储库在 Linux 上安装 MySQL2.5.7 Installing MySQL on Linux from the Native Software Repositories
- 2.5.8 在 Linux 上安装 MySQL Juju2.5.8 Installing MySQL on Linux with Juju
- 2.5.9 使用 systemd 管理 MySQL 服务器2.5.9 Managing MySQL Server with systemd
- 2.6 使用 Unbreakable Linux Network (ULN) 安装 MySQL2.6 Installing MySQL Using Unbreakable Linux Network (ULN)
- 2.7 在 Solaris 上安装 MySQL2.7 Installing MySQL on Solaris
- 2.8 从源安装 MySQL2.8 Installing MySQL from Source
- 2.8.1 源码安装方法2.8.1 Source Installation Methods
- 2.8.2 源码安装先决条件2.8.2 Source Installation Prerequisites
- 2.8.3 MySQL 源码布局安装2.8.3 MySQL Layout for Source Installation
- 2.8.4 使用标准源代码分发安装 MySQL2.8.4 Installing MySQL Using a Standard Source Distribution
- 2.8.5 使用开发源代码树安装 MySQL2.8.5 Installing MySQL Using a Development Source Tree
- 2.8.6 配置 SSL 库支持2.8.6 Configuring SSL Library Support
- 2.8.7 MySQL 源配置选项2.8.7 MySQL Source-Configuration Options
- 2.8.8 处理编译问题 MySQL2.8.8 Dealing with Problems Compiling MySQL
- 2.8.9 MySQL 配置和第三方工具2.8.9 MySQL Configuration and Third-Party Tools
- 2.8.10 生成 MySQL Doxygen 文档内容2.8.10 Generating MySQL Doxygen Documentation Content
- 2.9 安装后设置和测试2.9 Postinstallation Setup and Testing
- 2.10 Perl 安装说明2.10 Perl Installation Notes
本章介绍如何获取并安装 MySQL。下面是该过程的摘要,后面的部分提供了详细信息。如果您打算将 MySQL 的现有版本升级到较新版本,而不是首次安装 MySQL,请参阅第 3 章,升级 MySQL,了解有关升级过程以及升级前应考虑的问题的信息。This chapter describes how to obtain and install MySQL. A summary of the procedure follows and later sections provide the details. If you plan to upgrade an existing version of MySQL to a newer version rather than install MySQL for the first time, see Chapter 3, Upgrading MySQL, for information about upgrade procedures and about issues that you should consider before upgrading.
如果您有兴趣从其他数据库系统迁移到 MySQL,请参阅第 A.8 节“MySQL 8.4 常见问题解答:迁移”,其中包含有关迁移问题的一些常见问题的解答。If you are interested in migrating to MySQL from another database system, see Section A.8, “MySQL 8.4 FAQ: Migration”, which contains answers to some common questions concerning migration issues.
MySQL 的安装通常遵循以下步骤:Installation of MySQL generally follows the steps outlined here:
确定您的平台是否运行并支持 MySQL。Determine whether MySQL runs and is supported on your platform.
请注意,并非所有平台都同样适合运行 MySQL,并且并非所有已知运行 MySQL 的平台都得到 Oracle 公司的正式支持。有关官方支持的平台的信息,请参阅 MySQL 网站上的 https://www.mysql.com/support/supportedplatforms/database.html。Please note that not all platforms are equally suitable for running MySQL, and that not all platforms on which MySQL is known to run are officially supported by Oracle Corporation. For information about those platforms that are officially supported, see https://www.mysql.com/support/supportedplatforms/database.html on the MySQL website.
选择要安装的轨道。Choose which track to install.
MySQL 提供了 LTS 系列,例如 MySQL 8.4 和创新系列。它们解决了不同的用例,如 第 1.3 节“MySQL 版本:创新和 LTS” 中所述。MySQL offers an LTS series, such as MySQL 8.4, and an Innovation series. They address different use cases as described at Section 1.3, “MySQL Releases: Innovation and LTS”.
选择要安装的发行版。Choose which distribution to install.
MySQL 有多个版本,并且大多数版本都以多种发行版格式提供。您可以从包含二进制(预编译)程序或源代码的预打包发行版中进行选择。如有疑问,请使用二进制发行版。 Oracle 还为那些想要查看最新开发和测试新代码的人提供对 MySQL 源代码的访问。要确定应使用哪个版本和类型的发行版,请参阅第 2.1.2 节“要安装哪个 MySQL 版本和发行版”。Several versions of MySQL are available, and most are available in several distribution formats. You can choose from pre-packaged distributions containing binary (precompiled) programs or source code. When in doubt, use a binary distribution. Oracle also provides access to the MySQL source code for those who want to see recent developments and test new code. To determine which version and type of distribution you should use, see Section 2.1.2, “Which MySQL Version and Distribution to Install”.
下载要安装的发行版。Download the distribution that you want to install.
有关说明,请参阅第 2.1.3 节“如何获取 MySQL”。要验证分发的完整性,请使用第 2.1.4 节“使用 MD5 校验和或 GnuPG 验证包完整性”中的说明。For instructions, see Section 2.1.3, “How to Get MySQL”. To verify the integrity of the distribution, use the instructions in Section 2.1.4, “Verifying Package Integrity Using MD5 Checksums or GnuPG”.
安装Install the distribution.
要从二进制发行版安装 MySQL,请使用第 2.2 节“使用通用二进制文件在 Unix/Linux 上安装 MySQL” 中的说明。或者,使用安全部署指南,它提供了部署 MySQL Enterprise Edition Server 通用二进制发行版的过程,并具有管理 MySQL 安装安全性的功能。To install MySQL from a binary distribution, use the instructions in Section 2.2, “Installing MySQL on Unix/Linux Using Generic Binaries”. Alternatively, use the Secure Deployment Guide, which provides procedures for deploying a generic binary distribution of MySQL Enterprise Edition Server with features for managing the security of your MySQL installation.
要从源发行版或当前开发源代码树安装 MySQL,请使用第 2.8 节,“从源代码安装 MySQL”。To install MySQL from a source distribution or from the current development source tree, use the instructions in Section 2.8, “Installing MySQL from Source”.
执行任何必要的安装后设置。Perform any necessary postinstallation setup.
安装 MySQL 后,请参阅第 2.9 节“安装后设置和测试”,了解有关确保 MySQL 服务器正常工作的信息。另请参阅第 2.9.4 节“保护初始 MySQL 帐户”中提供的信息。本节介绍如何保护初始 MySQL
root用户帐户,在您分配密码之前 没有密码。无论您使用二进制还是源代码发行版安装 MySQL,本节均适用。After installing MySQL, see Section 2.9, “Postinstallation Setup and Testing”, for information about making sure the MySQL server is working properly. Also refer to the information provided in Section 2.9.4, “Securing the Initial MySQL Account”. This section describes how to secure the initial MySQLrootuser account, which has no password until you assign one. The section applies whether you install MySQL using a binary or source distribution.如果要运行 MySQL 基准测试脚本,则必须提供对 MySQL 的 Perl 支持。请参阅第 2.10 节“Perl 安装说明”。If you want to run the MySQL benchmark scripts, Perl support for MySQL must be available. See Section 2.10, “Perl Installation Notes”.
在不同平台和环境上安装 MySQL 的说明可根据不同的平台进行获取:Instructions for installing MySQL on different platforms and environments is available on a platform by platform basis:
Unix、LinuxUnix, Linux
有关在大多数 Linux 和 Unix 平台上安装 MySQL 的说明使用通用二进制文件(例如
.tar.gz包),请参阅第 2.2 节“使用通用二进制文件在 Unix/Linux 上安装 MySQL”。For instructions on installing MySQL on most Linux and Unix platforms using a generic binary (for example, a.tar.gzpackage), see Section 2.2, “Installing MySQL on Unix/Linux Using Generic Binaries”.有关完全从源代码发行版或源代码存储库构建 MySQL 的信息,请参阅第 2.8 节,“从源代码安装 MySQL”For information on building MySQL entirely from the source code distributions or the source code repositories, see Section 2.8, “Installing MySQL from Source”
有关安装、配置和从源代码构建的特定平台帮助,请参阅相应的平台部分:For specific platform help on installation, configuration, and building from source see the corresponding platform section:
Linux,包括有关发行版特定方法的说明,请参阅部分 2.5,“在 Linux 上安装 MySQL”。Linux, including notes on distribution specific methods, see Section 2.5, “Installing MySQL on Linux”.
IBM AIX,请参阅第 2.7 节,“在 Solaris 上安装 MySQL”。IBM AIX, see Section 2.7, “Installing MySQL on Solaris”.
Microsoft WindowsMicrosoft Windows
有关在 Microsoft Windows 上安装 MySQL 的说明,使用无论是 MSI 安装程序还是压缩二进制文件,请参阅第 2.3 节“在 Microsoft Windows 上安装 MySQL”。For instructions on installing MySQL on Microsoft Windows, using either the MSI installer or Zipped binary, see Section 2.3, “Installing MySQL on Microsoft Windows”.
有关从源代码构建 MySQL 的详细信息和说明,请参阅第 2.8 节“从以下位置安装 MySQL”来源”。For details and instructions on building MySQL from source code, see Section 2.8, “Installing MySQL from Source”.
macOSmacOS
有关 macOS 上的安装,包括使用二进制包和本机 PKG 格式,请参阅第 2.4 节“在 macOS 上安装 MySQL”。For installation on macOS, including using both the binary package and native PKG formats, see Section 2.4, “Installing MySQL on macOS”.
有关使用用于自动启动和停止 MySQL 的 macOS 启动守护程序,请参阅第 2.4.3 节“安装和使用 MySQL 启动守护程序”。For information on making use of an macOS Launch Daemon to automatically start and stop MySQL, see Section 2.4.3, “Installing and Using the MySQL Launch Daemon”.
有关 MySQL 首选项窗格的信息,请参阅第 2.4.4 节“安装和使用 MySQL 首选项窗格”。For information on the MySQL Preference Pane, see Section 2.4.4, “Installing and Using the MySQL Preference Pane”.