一、环境
- 阿里云主机
- CentOS 8.2
二、安装步骤
1.系统环境
Welcome to Alibaba Cloud Elastic Compute Service !
Activate the web console with: systemctl enable --now cockpit.socket
Last login: Wed Sep 16 08:49:31 2020 from 122.226.XXX.XX
[root@ZSSM01 ~]# lsb_release -a
LSB Version: :core-4.1-amd64:core-4.1-noarch
Distributor ID: CentOS
Description: CentOS Linux release 8.2.2004 (Core)
Release: 8.2.2004
Codename: Core
2.添加 MySQL 源
首先打开 MySQL 的官网,需要根据自己的服务器信息选择合适的源信息,因操作系统是 CentOS,所以选择的是 yum 源(yum 源地址:https://dev.mysql.com/downloads/repo/yum/)。
因操作系统是最新的CentOS8.2,所以选择了最新的MySql版本:mysql80-community-release-el8-1.noarch.rpm。
[root@ZSSM01 ~]# wget https://dev.mysql.com/get/mysql80-community-release-el8-1.noarch.rpm
[root@ZSSM01 ~]# rpm -ivh mysql80-community-release-el8-1.noarch.rpm
3. MD5校验
[root@ZSSM01 ~]# md5sum mysql80-community-release-el8-1.noarch.rpm
7166fed89332ab92fb3ec666e95d6ad1 mysql80-community-release-el8-1.noarch.rpm
4. 安装 MySQL
[root@ZSSM01 ~]# yum install mysql-server