官方文档
支持的系统和架构
Operating System
Architecture
Oracle Linux / Red Hat / CentOS
Oracle Linux 8 / Red Hat Enterprise Linux 8 / CentOS 8
x86_64, ARM 64
•
Oracle Linux 7 / Red Hat Enterprise Linux 7 / CentOS 7
ARM 64
•
Oracle Linux 7 / Red Hat Enterprise Linux 7 / CentOS 7
x86_64
•
•
•
Oracle Linux 6 / Red Hat Enterprise Linux 6 / CentOS 6
x86_32, x86_64
•
•
•
Oracle Solaris
Solaris 11 (Update 4+)
SPARC_64, x86_64
•
•
•
Solaris 10 (Update 11+)
SPARC_64, x86_32, x86_64
•
Canonical
Ubuntu 18.04 LTS
x86_32, x86_64
•
•
Ubuntu 16.04 LTS
x86_32, x86_64
•
•
SUSE
SUSE Enterprise Linux 15 / OpenSUSE 15
x86_64
•
SUSE Enterprise Linux 12 (12.3+)
x86_64
•
•
•
Debian
Debian GNU/Linux 10
x86_64
•
•
Debian GNU/Linux 9
x86_32, x86_64
•
•
•
Debian GNU/Linux 8
x86_32, x86_64
•
•
Microsoft Windows Server
Microsoft Windows 2019 Server
x86_64
•
Microsoft Windows 2016 Server
x86_64
•
•
•
Microsoft Windows 2012 Server R2
x86_64
•
•
•
Microsoft Windows
Microsoft Windows 10
x86_64
•
•
Apple
macOS 10.14
x86_64
•
•
macOS 10.13
x86_64
•
•
FreeBSD
FreeBSD 12
x86_64
•
Various Linux
Generic Linux (tar format)
x86_32, x86_64, glibc 2.12, libstdc++ 4.4
•
•
•
确认安装的版本
准备安装MySQL时,请确定要使用哪个版本和发行格式(二进制或源码)。
首先,决定要安装开发版本还是通用版本(GA)。开发版本具有最新功能,但不建议用于生产环境。GA版本(也称为生产版本或稳定版本)是供生产使用的。
MySQL 8.0中的命名方案使用的发行版名称由三个数字和一个可选的后缀组成(例如, **mysql-8.0.1-dmr**),版本名称中的数字解释如下:
- 第一个数字(**8**)是主版本号。- 第二个数字(**0**)是次要版本号。总而言之,主要和次要数字构成发行版本号。序列号描述了稳定的功能集。- 第三个数字(**1**)是发行系列中的版本号。对于每个新的错误修正版本,此值均递增。在大多数情况下,系列中的最新版本是最佳选择。
版本名称也可以包含一个后缀,以指示版本的稳定性。在一系列发行中,发布会通过一组后缀来指示稳定性水平如何提高。可能的后缀是:- **dmr**指示开发里程碑版本(DMR)。MySQL开发使用里程碑模型,其中每个里程碑都引入了一小部分经过全面测试的功能。从一个里程碑到下一个里程碑,基于尝试这些正常发布的社区成员提供的反馈,功能界面可能会更改,甚至功能可能会被删除。里程碑版本中的功能可能被视为具有预生产质量。- **rc**表示发布候选(RC)。通过了MySQL的所有内部测试后,发布候选版本被认为是稳定的。RC版本中可能仍会引入新功能,但是重点将转移到修复错误上,以稳定本系列中较早引入的功能。- 没有后缀表示具有一般可用性(GA)或正式版。GA版本稳定,已成功通过了较早的发行阶段,并且被认为是可靠的,没有严重的错误并且适合在生产系统中使用。
安装
安装依赖
[root@localhost local]# yum install -y libaio-devel
卸载mariadb的库
[root@localhost local]# yum remove -y mariadb-libs
添加用户和组
[root@localhost ~]# yum install -y bash-comple* tree telnet net-tools bind-utils
[root@localhost~]# groupadd mysql
[root@localhost~]# useradd -r -g mysql -M -s /sbin/nologin mysql
创建数据目录等
[root@localhost ~]# mkdir -p /data/mysql/data_3306
[root@localhost~]# mkdir -p /data/mysql/binlog_3306
上传软件包、校验和解压
[root@localhost ~]# mkdir /opt/softwares
[root@localhost~]# cd /opt/softwares
[root@localhost softwares]# rz-E
rz waiting to receive.
[root@localhost softwares]# ll
total1121804
-rw-r--r-- 1 root root 644869837 Dec 29 09:41 mysql-5.7.26-linux-glibc2.12-x86_64.tar.gz-rw-r--r-- 1 root root 503854832 Dec 28 03:22 mysql-8.0.18-linux-glibc2.12-x86_64.tar.xz
[root@localhost softwares]# md5sum mysql-5.7.26-linux-glibc2.12-x86_64.tar.gz
08a3b385db2f151598017b63fbcb6c43 mysql-5.7.26-linux-glibc2.12-x86_64.tar.gz
[root@localhost softw