installing.md 9.8 KB
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210
# 第 2 章 安装和升级 MySQL

**目录**


[2.1 一般安装指南](general-installation-issues.html)

[2.1.1 支持平台](platform-support.html)

[2.1.2 安装哪个 MySQL 版本和发行版](which-version.html)

[2.1.3 如何获取 MySQL](getting-mysql.html)

[2.1.4 使用 MD5 校验和或 GnuPG 验证包的完整性](verifying-package-integrity.html)

[2.1.5 安装布局](installation-layouts.html)

[2.1.6 编译器特定的构建特性](compiler-characteristics.html)

[2.2 使用通用二进制文件在 Unix/Linux 上安装 MySQL](binary-installation.html)

[2.3 在 Microsoft Windows 上安装 MySQL](windows-installation.html)

[2.3.1 Microsoft Windows 上的 MySQL 安装布局](windows-installation-layout.html)

[2.3.2 选择安装包](windows-choosing-package.html)

[2.3.3 适用于 Windows 的 MySQL 安装程序](mysql-installer.html)

[2.3.4 在 Microsoft Windows 上使用安装 MySQL`没有安装`压缩档案](windows-install-archive.html)

[2.3.5 Microsoft Windows MySQL 服务器安装故障排除](windows-troubleshooting.html)

[2.3.6 Windows 安装后程序](windows-postinstallation.html)

[2.3.7 Windows 平台限制](windows-restrictions.html)

[2.4 在 macOS 上安装 MySQL](macos-installation.html)

[2.4.1 在 macOS 上安装 MySQL 的一般注意事项](macos-installation-notes.html)

[2.4.2 使用原生包在 macOS 上安装 MySQL](macos-installation-pkg.html)

[2.4.3 安装和使用 MySQL 启动守护进程](macos-installation-launchd.html)

[2.4.4 安装和使用 MySQL 首选项窗格](macos-installation-prefpane.html)

[2.5 在 Linux 上安装 MySQL](linux-installation.html)

[2.5.1 使用 MySQL Yum 存储库在 Linux 上安装 MySQL](linux-installation-yum-repo.html)

[2.5.2 使用 MySQL APT 存储库在 Linux 上安装 MySQL](linux-installation-apt-repo.html)

[2.5.3 使用 MySQL SLES 存储库在 Linux 上安装 MySQL](linux-installation-sles-repo.html)

[2.5.4 使用 Oracle 的 RPM 包在 Linux 上安装 MySQL](linux-installation-rpm.html)

[2.5.5 使用 Oracle 的 Debian 软件包在 Linux 上安装 MySQL](linux-installation-debian.html)

[2.5.6 使用 Docker 在 Linux 上部署 MySQL](linux-installation-docker.html)

[2.5.7 从本机软件存储库在 Linux 上安装 MySQL](linux-installation-native.html)

[2.5.8 使用 Juju 在 Linux 上安装 MySQL](linux-installation-juju.html)

[2.5.9 使用 systemd 管理 MySQL 服务器](using-systemd.html)

[2.6 使用 Unbreakable Linux Network (ULN) 安装 MySQL](uln-installation.html)

[2.7 在 Solaris 上安装 MySQL](solaris-installation.html)

[2.7.1 使用 Solaris PKG 在 Solaris 上安装 MySQL](solaris-installation-pkg.html)

[2.8 在 FreeBSD 上安装 MySQL](freebsd-installation.html)

[2.9 从源代码安装 MySQL](source-installation.html)

[2.9.1 源码安装方式](source-installation-methods.html)

[2.9.2 源码安装先决条件](source-installation-prerequisites.html)

[2.9.3 MySQL 源码安装布局](source-installation-layout.html)

[2.9.4 使用标准源分发安装 MySQL](installing-source-distribution.html)

[2.9.5 使用开发源码树安装 MySQL](installing-development-tree.html)

[2.9.6 配置 SSL 库支持](source-ssl-library-configuration.html)

[2.9.7 MySQL 源配置选项](source-configuration-options.html)

[2.9.8 处理编译 MySQL 的问题](compilation-problems.html)

[2.9.9 MySQL 配置和第三方工具](source-configuration-third-party.html)

[2.9.10 生成 MySQL Doxygen 文档内容](source-installation-doxygen.html)

[2.10 安装后设置和测试](postinstallation.html)

[2.10.1 初始化数据目录](data-directory-initialization.html)

[2.10.2 启动服务器](starting-server.html)

[2.10.3 测试服务器](testing-server.html)

[2.10.4 保护初始 MySQL 帐户](default-privileges.html)

[2.10.5 自动启动和停止 MySQL](automatic-start.html)

[2.11 升级 MySQL](upgrading.html)

[2.11.1 开始之前](upgrade-before-you-begin.html)

[2.11.2 升级路径](upgrade-paths.html)

[2.11.3 MySQL升级过程升级了什么](upgrading-what-is-upgraded.html)

[2.11.4 MySQL 8.0 的变化](upgrading-from-previous-series.html)

[2.11.5 准备升级安装](upgrade-prerequisites.html)

[2.11.6 在 Unix/Linux 上升级 MySQL 二进制或基于包的安装](upgrade-binary-package.html)

[2.11.7 使用 MySQL Yum 存储库升级 MySQL](updating-yum-repo.html)

[2.11.8 使用 MySQL APT 存储库升级 MySQL](updating-apt-repo.html)

[2.11.9 使用 MySQL SLES 存储库升级 MySQL](updating-sles-repo.html)

[2.11.10 在 Windows 上升级 MySQL](windows-upgrading.html)

[2.11.11 升级 MySQL 的 Docker 安装](upgrade-docker-mysql.html)

[2.11.12 升级疑难解答](upgrade-troubleshooting.html)

[2.11.13 重建或修复表或索引](rebuilding-tables.html)

[2.11.14 将 MySQL 数据库复制到另一台机器](copying-databases.html)

[2.12 降级 MySQL](downgrading.html)

[2.13 Perl 安装注意事项](perl-support.html)

[2.13.1 在 Unix 上安装 Perl](perl-installation.html)

[2.13.2 在 Windows 上安装 ActiveState Perl](activestate-perl.html)

[2.13.3 使用 Perl DBI/DBD 接口的问题](perl-support-problems.html)

[](<>)

本章介绍如何获取和安装 MySQL。以下是该过程的摘要,后面的部分提供了详细信息。如果您计划将现有版本的 MySQL 升级到较新的版本,而不是第一次安装 MySQL,请参阅[第 2.11 节,“升级 MySQL”](upgrading.html),有关升级过程和升级前应考虑的问题的信息。

如果您有兴趣从另一个数据库系统迁移到 MySQL,请参阅[第 A.8 节,“MySQL 8.0 常见问题解答:迁移”](faqs-migration.html),其中包含有关迁移问题的一些常见问题的答案。

MySQL 的安装通常遵循此处列出的步骤:

1.  **确定 MySQL 是否在您的平台上运行并受支持。**

    请注意,并非所有平台都同样适合运行 MySQL,并且并非所有已知运行 MySQL 的平台都得到 Oracle Corporation 的正式支持。有关官方支持的平台的信息,请参阅<https://www.mysql.com/support/supportedplatforms/database.html>在 MySQL 网站上。

2.  **选择要安装的发行版。**

    有多个版本的 MySQL 可用,并且大多数都以多种分发格式提供。您可以从包含二进制(预编译)程序或源代码的预打包发行版中进行选择。如有疑问,请使用二进制分发。Oracle 还为希望了解最新开发和测试新代码的人提供对 MySQL 源代码的访问。要确定您应该使用哪个版本和类型的发行版,请参阅[第 2.1.2 节,“要安装哪个 MySQL 版本和发行版”](which-version.html).

3.  **下载您要安装的发行版。**

    有关说明,请参阅[第 2.1.3 节,“如何获取 MySQL”](getting-mysql.html).要验证分发的完整性,请使用中的说明[第 2.1.4 节,“使用 MD5 校验和或 GnuPG 验证包完整性”](verifying-package-integrity.html).

4.  **安装发行版。**

    要从二进制发行版安装 MySQL,请使用中的说明[第 2.2 节,“使用通用二进制文件在 Unix/Linux 上安装 MySQL”](binary-installation.html).或者,使用[安全部署指南](https://dev.mysql.com/doc/mysql-secure-deployment-guide/8.0/en/),它提供了部署 MySQL Enterprise Edition Server 的通用二进制发行版的过程,该发行版具有管理 MySQL 安装安全性的功能。

    要从源代码分发版或当前开发源代码树安装 MySQL,请使用中的说明[第 2.9 节,“从源代码安装 MySQL”](source-installation.html).

5.  **执行任何必要的安装后设置。**

    安装 MySQL 后,请参见[第 2.10 节,“安装后设置和测试”](postinstallation.html)有关确保 MySQL 服务器正常工作的信息。另请参阅提供的信息[第 2.10.4 节,“保护初始 MySQL 帐户”](default-privileges.html).本节介绍如何保护初始 MySQL`根`用户帐号,*没有密码*直到你分配一个。无论您使用二进制还是源代码分发安装 MySQL,该部分都适用。

6.  如果要运行 MySQL 基准测试脚本,必须提供对 MySQL 的 Perl 支持。看[第 2.13 节,“Perl 安装说明”](perl-support.html).

    在不同平台和环境上安装 MySQL 的说明可在不同平台上获得:

-   **Unix、Linux、FreeBSD**

    有关在大多数 Linux 和 Unix 平台上使用通用二进制文件(例如,`.tar.gz`包),见[第 2.2 节,“使用通用二进制文件在 Unix/Linux 上安装 MySQL”](binary-installation.html).

    有关完全从源代码分发或源代码存储库构建 MySQL 的信息,请参阅[第 2.9 节,“从源代码安装 MySQL”](source-installation.html)

    有关安装、配置和从源代码构建的特定平台帮助,请参阅相应的平台部分:

    -   Linux,包括有关分发特定方法的说明,请参阅[第 2.5 节,“在 Linux 上安装 MySQL”](linux-installation.html).

    -   IBM AIX,请参阅[第 2.7 节,“在 Solaris 上安装 MySQL”](solaris-installation.html).

    -   FreeBSD,请参阅[第 2.8 节,“在 FreeBSD 上安装 MySQL”](freebsd-installation.html).

-   **微软Windows**

    有关使用 MySQL Installer 或 Zipped 二进制文件在 Microsoft Windows 上安装 MySQL 的说明,请参阅[第 2.3 节,“在 Microsoft Windows 上安装 MySQL”](windows-installation.html).

    有关使用 Microsoft Visual Studio 从源代码构建 MySQL 的详细信息和说明,请参阅[第 2.9 节,“从源代码安装 MySQL”](source-installation.html).

-   **苹果系统**

    对于 macOS 上的安装,包括使用二进制包和原生 PKG 格式,请参阅[第 2.4 节,“在 macOS 上安装 MySQL”](macos-installation.html).

    有关使用 macOS 启动守护程序自动启动和停止 MySQL 的信息,请参阅[第 2.4.3 节,“安装和使用 MySQL 启动守护程序”](macos-installation-launchd.html).

    有关 MySQL 首选项窗格的信息,请参阅[第 2.4.4 节,“安装和使用 MySQL 首选项窗格”](macos-installation-prefpane.html).