代码改变世界

centos8 minial yum 安装mysql8.0.21

2021-03-26 10:37  方斌  阅读(222)  评论(0编辑  收藏  举报

centos8 minial yum 安装mysql8

检测系统是否自带安装 MySQL

命令如下:
rpm -qa | grep mysql
如果如下存在已安装的包,就需要卸载
mysql80-community-release-el8-1.noarch
mysql-community-client-8.0.18-1.el8.x86_64
mysql-community-libs-8.0.18-1.el8.x86_64
mysql-community-server-8.0.18-1.el8.x86_64
mysql-community-common-8.0.18-1.el8.x86_64

卸载命令

存在mysql已安装的包就需要依次卸载

rpm -e mysql  // 普通删除
rpm -e --nodeps mysql  // 强力删除模式,如果使用上面命令删除时,提示有依赖的其它文件,则用该命令可以对其进行强力删

查看是否安装了mariadb;

rpm -pa | grep mariadb

如果有安装的话使用如下命令移除:

rpm -e XXX

rpm -e --nodeps xxx //强制删除

去官网下载yum rpm包

官网地址为 https://dev.mysql.com/downloads/repo/yum/

下载这个版本Red Hat Enterprise Linux 8 / Oracle Linux 8 (Architecture Independent), RPM Package

安装 yum源

rpm -ivh mysql-community-release-el8-1.noarch.rpm
  • 效果如下
[root@mysql8 home]# rpm -ivh mysql80-community-release-el8-1.noarch.rpm 
warning: mysql80-community-release-el8-1.noarch.rpm: Header V3 DSA/SHA1 Signature, key ID 5072e1f5: NOKEY
Verifying...                          ################################# [100%]
Preparing...                          ################################# [100%]
Updating / installing...
   1:mysql80-community-release-el8-1  ################################# [100%]
[root@mysql8 home]# cd /etc/yum.repos.d/
[root@mysql8 yum.repos.d]# ll
total 12
-rw-r--r--. 1 root root 2595 Dec 26 19:31 CentOS-Base.repo
-rw-r--r--. 1 root root  995 Oct  4  2019 mysql-community.repo
-rw-r--r--. 1 root root 1050 Oct  4  2019 mysql-community-source.repo

更新

yum update
  • 效果如下
[root@mysql8 yum.repos.d]# yum update
CentOS-8 - Base - mirrors.aliyun.com            22 kB/s | 3.9 kB     00:00    
CentOS-8 - Base - mirrors.aliyun.com           3.4 MB/s | 2.3 MB     00:00    
CentOS-8 - Extras - mirrors.aliyun.com         5.5 kB/s | 1.5 kB     00:00    
CentOS-8 - Extras - mirrors.aliyun.com          17 kB/s | 9.4 kB     00:00    
CentOS-8 - AppStream - mirrors.aliyun.com       38 kB/s | 4.3 kB     00:00    
CentOS-8 - AppStream - mirrors.aliyun.com      4.3 MB/s | 6.3 MB     00:01    
MySQL 8.0 Community Server                     2.4 MB/s | 1.3 MB     00:00    
MySQL Connectors Community                     196 kB/s |  49 kB     00:00    
MySQL Tools Community                          444 kB/s | 188 kB     00:00    
Dependencies resolved.
===============================================================================
 Package                  Arch    Version                          Repo   Size
===============================================================================
Installing:
 kernel                   x86_64  4.18.0-240.15.1.el8_3            base  4.3 M
 kernel-core              x86_64  4.18.0-240.15.1.el8_3            base   30 M
 kernel-modules           x86_64  4.18.0-240.15.1.el8_3            base   26 M
Upgrading:
 NetworkManager           x86_64  1:1.26.0-12.el8_3                base  2.4 M
 NetworkManager-libnm     x86_64  1:1.26.0-12.el8_3                base  1.8 M
 NetworkManager-team      x86_64  1:1.26.0-12.el8_3                base  142 k
 NetworkManager-tui       x86_64  1:1.26.0-12.el8_3                base  320 k
 bind-export-libs         x86_64  32:9.11.20-5.el8_3.1             base  1.1 M
 curl                     x86_64  7.61.1-14.el8_3.1                base  353 k
 dracut                   x86_64  049-95.git20200804.el8_3.4       base  368 k
 dracut-config-rescue     x86_64  049-95.git20200804.el8_3.4       base   56 k
 dracut-network           x86_64  049-95.git20200804.el8_3.4       base  103 k
 dracut-squash            x86_64  049-95.git20200804.el8_3.4       base   57 k
 freetype                 x86_64  2.9.1-4.el8_3.1                  base  394 k
 gnutls                   x86_64  3.6.14-7.el8_3                   base  1.0 M
 grub2-common             noarch  1:2.02-90.el8_3.1                base  885 k
 grub2-pc                 x86_64  1:2.02-90.el8_3.1                base   39 k
 grub2-pc-modules         noarch  1:2.02-90.el8_3.1                base  868 k
 grub2-tools              x86_64  1:2.02-90.el8_3.1                base  2.0 M
 grub2-tools-extra        x86_64  1:2.02-90.el8_3.1                base  1.1 M
 grub2-tools-minimal      x86_64  1:2.02-90.el8_3.1                base  206 k
 iptables                 x86_64  1.8.4-15.el8_3.3                 base  584 k
 iptables-ebtables        x86_64  1.8.4-15.el8_3.3                 base   71 k
 iptables-libs            x86_64  1.8.4-15.el8_3.3                 base  106 k
 iwl100-firmware          noarch  39.31.5.1-101.el8_3.1            base  169 k
 iwl1000-firmware         noarch  1:39.31.5.1-101.el8_3.1          base  232 k
 iwl105-firmware          noarch  18.168.6.1-101.el8_3.1           base  253 k
 iwl135-firmware          noarch  18.168.6.1-101.el8_3.1           base  262 k
 iwl2000-firmware         noarch  18.168.6.1-101.el8_3.1           base  256 k
 iwl2030-firmware         noarch  18.168.6.1-101.el8_3.1           base  265 k
 iwl3160-firmware         noarch  1:25.30.13.0-101.el8_3.1         base  1.7 M
 iwl5000-firmware         noarch  8.83.5.1_1-101.el8_3.1           base  313 k
 iwl5150-firmware         noarch  8.24.2.2-101.el8_3.1             base  166 k
 iwl6000-firmware         noarch  9.221.4.1-101.el8_3.1            base  186 k
 iwl6000g2a-firmware      noarch  18.168.6.1-101.el8_3.1           base  329 k
 iwl6050-firmware         noarch  41.28.5.1-101.el8_3.1            base  262 k
 iwl7260-firmware         noarch  1:25.30.13.0-101.el8_3.1         base   15 M
 kernel-tools             x86_64  4.18.0-240.15.1.el8_3            base  4.5 M
 kernel-tools-libs        x86_64  4.18.0-240.15.1.el8_3            base  4.4 M
 kexec-tools              x86_64  2.0.20-34.el8_3.1                base  496 k
 libcurl                  x86_64  7.61.1-14.el8_3.1                base  299 k
 libselinux               x86_64  2.9-4.el8_3                      base  165 k
 libselinux-utils         x86_64  2.9-4.el8_3                      base  242 k
 linux-firmware           noarch  20200619-101.git3890db36.el8_3   base  101 M
 microcode_ctl            x86_64  4:20200609-2.20210216.1.el8_3    base  4.6 M
 openssl                  x86_64  1:1.1.1g-12.el8_3                base  707 k
 openssl-libs             x86_64  1:1.1.1g-12.el8_3                base  1.5 M
 python3-libselinux       x86_64  2.9-4.el8_3                      base  283 k
 python3-perf             x86_64  4.18.0-240.15.1.el8_3            base  4.5 M
 selinux-policy           noarch  3.14.3-54.el8_3.2                base  622 k
 selinux-policy-targeted  noarch  3.14.3-54.el8_3.2                base   15 M
 sudo                     x86_64  1.8.29-6.el8_3.1                 base  924 k
 systemd                  x86_64  239-41.el8_3.1                   base  3.5 M
 systemd-libs             x86_64  239-41.el8_3.1                   base  1.1 M
 systemd-pam              x86_64  239-41.el8_3.1                   base  456 k
 systemd-udev             x86_64  239-41.el8_3.1                   base  1.3 M
 tuned                    noarch  2.14.0-3.el8_3.1                 base  292 k
 tzdata                   noarch  2021a-1.el8                      base  473 k
Installing dependencies:
 grub2-tools-efi          x86_64  1:2.02-90.el8_3.1                base  471 k

Transaction Summary
===============================================================================
Install   4 Packages
Upgrade  55 Packages

Total download size: 240 M
Is this ok [y/N]: y
Downloading Packages:
(1/59): grub2-tools-efi-2.02-90.el8_3.1.x86_64 858 kB/s | 471 kB     00:00    
(2/59): kernel-4.18.0-240.15.1.el8_3.x86_64.rp 4.2 MB/s | 4.3 MB     00:01    
(3/59): NetworkManager-1.26.0-12.el8_3.x86_64. 2.9 MB/s | 2.4 MB     00:00    
(4/59): NetworkManager-libnm-1.26.0-12.el8_3.x 3.0 MB/s | 1.8 MB     00:00    
(5/59): NetworkManager-team-1.26.0-12.el8_3.x8 1.6 MB/s | 142 kB     00:00    
(6/59): NetworkManager-tui-1.26.0-12.el8_3.x86 1.9 MB/s | 320 kB     00:00    
(7/59): bind-export-libs-9.11.20-5.el8_3.1.x86 2.7 MB/s | 1.1 MB     00:00    
(8/59): curl-7.61.1-14.el8_3.1.x86_64.rpm      1.9 MB/s | 353 kB     00:00    
(9/59): dracut-049-95.git20200804.el8_3.4.x86_ 1.8 MB/s | 368 kB     00:00    
(10/59): dracut-config-rescue-049-95.git202008 343 kB/s |  56 kB     00:00    
(11/59): dracut-network-049-95.git20200804.el8 986 kB/s | 103 kB     00:00    
(12/59): dracut-squash-049-95.git20200804.el8_ 505 kB/s |  57 kB     00:00    
(13/59): freetype-2.9.1-4.el8_3.1.x86_64.rpm   2.4 MB/s | 394 kB     00:00    
(14/59): gnutls-3.6.14-7.el8_3.x86_64.rpm      2.7 MB/s | 1.0 MB     00:00    
(15/59): grub2-common-2.02-90.el8_3.1.noarch.r 2.3 MB/s | 885 kB     00:00    
(16/59): kernel-core-4.18.0-240.15.1.el8_3.x86 6.2 MB/s |  30 MB     00:04    
(17/59): grub2-pc-2.02-90.el8_3.1.x86_64.rpm   292 kB/s |  39 kB     00:00    
(18/59): grub2-pc-modules-2.02-90.el8_3.1.noar 4.0 MB/s | 868 kB     00:00    
(19/59): grub2-tools-2.02-90.el8_3.1.x86_64.rp 4.3 MB/s | 2.0 MB     00:00    
(20/59): grub2-tools-extra-2.02-90.el8_3.1.x86 3.9 MB/s | 1.1 MB     00:00    
(21/59): grub2-tools-minimal-2.02-90.el8_3.1.x 2.1 MB/s | 206 kB     00:00    
(22/59): iptables-ebtables-1.8.4-15.el8_3.3.x8 1.5 MB/s |  71 kB     00:00    
(23/59): iptables-libs-1.8.4-15.el8_3.3.x86_64 1.1 MB/s | 106 kB     00:00    
(24/59): iptables-1.8.4-15.el8_3.3.x86_64.rpm  2.4 MB/s | 584 kB     00:00    
(25/59): iwl100-firmware-39.31.5.1-101.el8_3.1 2.4 MB/s | 169 kB     00:00    
(26/59): iwl1000-firmware-39.31.5.1-101.el8_3. 1.5 MB/s | 232 kB     00:00    
(27/59): iwl105-firmware-18.168.6.1-101.el8_3. 2.0 MB/s | 253 kB     00:00    
(28/59): iwl135-firmware-18.168.6.1-101.el8_3. 2.4 MB/s | 262 kB     00:00    
(29/59): iwl2000-firmware-18.168.6.1-101.el8_3 2.1 MB/s | 256 kB     00:00    
(30/59): iwl2030-firmware-18.168.6.1-101.el8_3 3.2 MB/s | 265 kB     00:00    
(31/59): kernel-modules-4.18.0-240.15.1.el8_3. 4.6 MB/s |  26 MB     00:05    
(32/59): iwl5000-firmware-8.83.5.1_1-101.el8_3 2.5 MB/s | 313 kB     00:00    
(33/59): iwl5150-firmware-8.24.2.2-101.el8_3.1 2.7 MB/s | 166 kB     00:00    
(34/59): iwl3160-firmware-25.30.13.0-101.el8_3 6.8 MB/s | 1.7 MB     00:00    
(35/59): iwl6000-firmware-9.221.4.1-101.el8_3. 2.0 MB/s | 186 kB     00:00    
(36/59): iwl6000g2a-firmware-18.168.6.1-101.el 3.4 MB/s | 329 kB     00:00    
(37/59): iwl6050-firmware-41.28.5.1-101.el8_3. 2.8 MB/s | 262 kB     00:00    
(38/59): kernel-tools-libs-4.18.0-240.15.1.el8 4.4 MB/s | 4.4 MB     00:00    
(39/59): kernel-tools-4.18.0-240.15.1.el8_3.x8 4.1 MB/s | 4.5 MB     00:01    
(40/59): kexec-tools-2.0.20-34.el8_3.1.x86_64. 4.2 MB/s | 496 kB     00:00    
(41/59): libselinux-2.9-4.el8_3.x86_64.rpm     2.3 MB/s | 165 kB     00:00    
(42/59): libcurl-7.61.1-14.el8_3.1.x86_64.rpm  2.5 MB/s | 299 kB     00:00    
(43/59): libselinux-utils-2.9-4.el8_3.x86_64.r 2.2 MB/s | 242 kB     00:00    
(44/59): microcode_ctl-20200609-2.20210216.1.e 2.3 MB/s | 4.6 MB     00:02    
(45/59): openssl-1.1.1g-12.el8_3.x86_64.rpm    3.5 MB/s | 707 kB     00:00    
(46/59): iwl7260-firmware-25.30.13.0-101.el8_3 4.0 MB/s |  15 MB     00:03    
(47/59): python3-libselinux-2.9-4.el8_3.x86_64 3.2 MB/s | 283 kB     00:00    
(48/59): openssl-libs-1.1.1g-12.el8_3.x86_64.r 5.4 MB/s | 1.5 MB     00:00    
(49/59): selinux-policy-3.14.3-54.el8_3.2.noar 2.3 MB/s | 622 kB     00:00    
(50/59): python3-perf-4.18.0-240.15.1.el8_3.x8 4.9 MB/s | 4.5 MB     00:00    
(51/59): sudo-1.8.29-6.el8_3.1.x86_64.rpm      3.6 MB/s | 924 kB     00:00    
(52/59): systemd-239-41.el8_3.1.x86_64.rpm     4.3 MB/s | 3.5 MB     00:00    
(53/59): systemd-libs-239-41.el8_3.1.x86_64.rp 3.3 MB/s | 1.1 MB     00:00    
(54/59): systemd-pam-239-41.el8_3.1.x86_64.rpm 3.4 MB/s | 456 kB     00:00    
(55/59): systemd-udev-239-41.el8_3.1.x86_64.rp 3.0 MB/s | 1.3 MB     00:00    
(56/59): tuned-2.14.0-3.el8_3.1.noarch.rpm     2.7 MB/s | 292 kB     00:00    
(57/59): tzdata-2021a-1.el8.noarch.rpm         3.8 MB/s | 473 kB     00:00    
(58/59): selinux-policy-targeted-3.14.3-54.el8 5.0 MB/s |  15 MB     00:03    
(59/59): linux-firmware-20200619-101.git3890db 7.1 MB/s | 101 MB     00:14    
-------------------------------------------------------------------------------
Total                                           11 MB/s | 240 MB     00:21     
Running transaction check
Transaction check succeeded.
Running transaction test
Transaction test succeeded.
Running transaction
  Preparing        :                                                       1/1 
  Running scriptlet: grub2-common-1:2.02-90.el8_3.1.noarch                 1/1 
  Upgrading        : grub2-common-1:2.02-90.el8_3.1.noarch               1/114 
  Upgrading        : libselinux-2.9-4.el8_3.x86_64                       2/114 
  Running scriptlet: libselinux-2.9-4.el8_3.x86_64                       2/114 
  Upgrading        : systemd-libs-239-41.el8_3.1.x86_64                  3/114 
  Running scriptlet: systemd-libs-239-41.el8_3.1.x86_64                  3/114 
  Upgrading        : openssl-libs-1:1.1.1g-12.el8_3.x86_64               4/114 
  Running scriptlet: openssl-libs-1:1.1.1g-12.el8_3.x86_64               4/114 
  Upgrading        : gnutls-3.6.14-7.el8_3.x86_64                        5/114 
  Upgrading        : NetworkManager-libnm-1:1.26.0-12.el8_3.x86_64       6/114 
  Running scriptlet: NetworkManager-libnm-1:1.26.0-12.el8_3.x86_64       6/114 
  Upgrading        : libcurl-7.61.1-14.el8_3.1.x86_64                    7/114 
  Upgrading        : grub2-tools-minimal-1:2.02-90.el8_3.1.x86_64        8/114 
  Upgrading        : iptables-libs-1.8.4-15.el8_3.3.x86_64               9/114 
  Upgrading        : systemd-pam-239-41.el8_3.1.x86_64                  10/114 
  Running scriptlet: systemd-239-41.el8_3.1.x86_64                      11/114 
  Upgrading        : systemd-239-41.el8_3.1.x86_64                      11/114 
  Running scriptlet: systemd-239-41.el8_3.1.x86_64                      11/114 
  Running scriptlet: NetworkManager-1:1.26.0-12.el8_3.x86_64            12/114 
  Upgrading        : NetworkManager-1:1.26.0-12.el8_3.x86_64            12/114 
  Running scriptlet: NetworkManager-1:1.26.0-12.el8_3.x86_64            12/114 
  Upgrading        : systemd-udev-239-41.el8_3.1.x86_64                 13/114 
  Running scriptlet: systemd-udev-239-41.el8_3.1.x86_64                 13/114 
  Upgrading        : dracut-049-95.git20200804.el8_3.4.x86_64           14/114 
  Upgrading        : dracut-network-049-95.git20200804.el8_3.4.x86_6    15/114 
  Upgrading        : dracut-squash-049-95.git20200804.el8_3.4.x86_64    16/114 
  Running scriptlet: grub2-tools-1:2.02-90.el8_3.1.x86_64               17/114 
  Upgrading        : grub2-tools-1:2.02-90.el8_3.1.x86_64               17/114 
  Running scriptlet: grub2-tools-1:2.02-90.el8_3.1.x86_64               17/114 
  Running scriptlet: iptables-1.8.4-15.el8_3.3.x86_64                   18/114 
  Upgrading        : iptables-1.8.4-15.el8_3.3.x86_64                   18/114 
  Running scriptlet: iptables-1.8.4-15.el8_3.3.x86_64                   18/114 
  Upgrading        : grub2-pc-modules-1:2.02-90.el8_3.1.noarch          19/114 
  Upgrading        : selinux-policy-3.14.3-54.el8_3.2.noarch            20/114 
  Running scriptlet: selinux-policy-3.14.3-54.el8_3.2.noarch            20/114 
  Upgrading        : python3-perf-4.18.0-240.15.1.el8_3.x86_64          21/114 
  Upgrading        : linux-firmware-20200619-101.git3890db36.el8_3.n    22/114 
  Installing       : kernel-core-4.18.0-240.15.1.el8_3.x86_64           23/114 
  Running scriptlet: kernel-core-4.18.0-240.15.1.el8_3.x86_64           23/114 
  Installing       : kernel-modules-4.18.0-240.15.1.el8_3.x86_64        24/114 
  Running scriptlet: kernel-modules-4.18.0-240.15.1.el8_3.x86_64        24/114 
  Upgrading        : kernel-tools-libs-4.18.0-240.15.1.el8_3.x86_64     25/114 
  Running scriptlet: kernel-tools-libs-4.18.0-240.15.1.el8_3.x86_64     25/114 
  Upgrading        : kernel-tools-4.18.0-240.15.1.el8_3.x86_64          26/114 
  Upgrading        : freetype-2.9.1-4.el8_3.1.x86_64                    27/114 
  Upgrading        : grub2-tools-extra-1:2.02-90.el8_3.1.x86_64         28/114 
  Upgrading        : grub2-pc-1:2.02-90.el8_3.1.x86_64                  29/114 
  Upgrading        : tuned-2.14.0-3.el8_3.1.noarch                      30/114 
  Running scriptlet: tuned-2.14.0-3.el8_3.1.noarch                      30/114 
  Installing       : kernel-4.18.0-240.15.1.el8_3.x86_64                31/114 
  Running scriptlet: selinux-policy-targeted-3.14.3-54.el8_3.2.noarc    32/114 
  Upgrading        : selinux-policy-targeted-3.14.3-54.el8_3.2.noarc    32/114 
  Running scriptlet: selinux-policy-targeted-3.14.3-54.el8_3.2.noarc    32/114 
  Upgrading        : iptables-ebtables-1.8.4-15.el8_3.3.x86_64          33/114 
  Running scriptlet: iptables-ebtables-1.8.4-15.el8_3.3.x86_64          33/114 
  Upgrading        : kexec-tools-2.0.20-34.el8_3.1.x86_64               34/114 
  Running scriptlet: kexec-tools-2.0.20-34.el8_3.1.x86_64               34/114 
  Upgrading        : dracut-config-rescue-049-95.git20200804.el8_3.4    35/114 
  Upgrading        : NetworkManager-team-1:1.26.0-12.el8_3.x86_64       36/114 
  Upgrading        : NetworkManager-tui-1:1.26.0-12.el8_3.x86_64        37/114 
  Upgrading        : microcode_ctl-4:20200609-2.20210216.1.el8_3.x86    38/114 
  Running scriptlet: microcode_ctl-4:20200609-2.20210216.1.el8_3.x86    38/114 
  Upgrading        : curl-7.61.1-14.el8_3.1.x86_64                      39/114 
  Upgrading        : bind-export-libs-32:9.11.20-5.el8_3.1.x86_64       40/114 
  Running scriptlet: bind-export-libs-32:9.11.20-5.el8_3.1.x86_64       40/114 
  Upgrading        : openssl-1:1.1.1g-12.el8_3.x86_64                   41/114 
  Upgrading        : libselinux-utils-2.9-4.el8_3.x86_64                42/114 
  Upgrading        : python3-libselinux-2.9-4.el8_3.x86_64              43/114 
  Upgrading        : sudo-1.8.29-6.el8_3.1.x86_64                       44/114 
  Running scriptlet: sudo-1.8.29-6.el8_3.1.x86_64                       44/114 
  Installing       : grub2-tools-efi-1:2.02-90.el8_3.1.x86_64           45/114 
  Upgrading        : tzdata-2021a-1.el8.noarch                          46/114 
  Upgrading        : iwl7260-firmware-1:25.30.13.0-101.el8_3.1.noarc    47/114 
  Upgrading        : iwl6050-firmware-41.28.5.1-101.el8_3.1.noarch      48/114 
  Upgrading        : iwl6000g2a-firmware-18.168.6.1-101.el8_3.1.noar    49/114 
  Upgrading        : iwl6000-firmware-9.221.4.1-101.el8_3.1.noarch      50/114 
  Upgrading        : iwl5150-firmware-8.24.2.2-101.el8_3.1.noarch       51/114 
  Upgrading        : iwl5000-firmware-8.83.5.1_1-101.el8_3.1.noarch     52/114 
  Upgrading        : iwl3160-firmware-1:25.30.13.0-101.el8_3.1.noarc    53/114 
  Upgrading        : iwl2030-firmware-18.168.6.1-101.el8_3.1.noarch     54/114 
  Upgrading        : iwl2000-firmware-18.168.6.1-101.el8_3.1.noarch     55/114 
  Upgrading        : iwl135-firmware-18.168.6.1-101.el8_3.1.noarch      56/114 
  Upgrading        : iwl105-firmware-18.168.6.1-101.el8_3.1.noarch      57/114 
  Upgrading        : iwl1000-firmware-1:39.31.5.1-101.el8_3.1.noarch    58/114 
  Upgrading        : iwl100-firmware-39.31.5.1-101.el8_3.1.noarch       59/114 
  Cleanup          : NetworkManager-tui-1:1.26.0-8.el8.x86_64           60/114 
  Cleanup          : grub2-pc-1:2.02-90.el8.x86_64                      61/114 
  Cleanup          : openssl-1:1.1.1g-11.el8.x86_64                     62/114 
  Running scriptlet: kexec-tools-2.0.20-34.el8.x86_64                   63/114 
  Cleanup          : kexec-tools-2.0.20-34.el8.x86_64                   63/114 
  Running scriptlet: kexec-tools-2.0.20-34.el8.x86_64                   63/114 
  Running scriptlet: tuned-2.14.0-3.el8.noarch                          64/114 
  Cleanup          : tuned-2.14.0-3.el8.noarch                          64/114 
  Running scriptlet: tuned-2.14.0-3.el8.noarch                          64/114 
  Cleanup          : curl-7.61.1-14.el8.x86_64                          65/114 
  Running scriptlet: microcode_ctl-4:20200609-2.el8.x86_64              66/114 
  Cleanup          : microcode_ctl-4:20200609-2.el8.x86_64              66/114 
  Running scriptlet: microcode_ctl-4:20200609-2.el8.x86_64              66/114 
  Running scriptlet: grub2-tools-1:2.02-90.el8.x86_64                   67/114 
  Cleanup          : grub2-tools-1:2.02-90.el8.x86_64                   67/114 
  Cleanup          : grub2-tools-extra-1:2.02-90.el8.x86_64             68/114 
  Cleanup          : bind-export-libs-32:9.11.20-5.el8.x86_64           69/114 
  Running scriptlet: bind-export-libs-32:9.11.20-5.el8.x86_64           69/114 
  Cleanup          : selinux-policy-targeted-3.14.3-54.el8.noarch       70/114 
  Running scriptlet: selinux-policy-targeted-3.14.3-54.el8.noarch       70/114 
  Cleanup          : dracut-network-049-95.git20200804.el8.x86_64       71/114 
  Cleanup          : dracut-squash-049-95.git20200804.el8.x86_64        72/114 
  Cleanup          : grub2-pc-modules-1:2.02-90.el8.noarch              73/114 
  Running scriptlet: iptables-ebtables-1.8.4-15.el8.x86_64              74/114 
  Cleanup          : iptables-ebtables-1.8.4-15.el8.x86_64              74/114 
  Running scriptlet: iptables-ebtables-1.8.4-15.el8.x86_64              74/114 
  Cleanup          : dracut-config-rescue-049-95.git20200804.el8.x86    75/114 
  Cleanup          : dracut-049-95.git20200804.el8.x86_64               76/114 
  Cleanup          : systemd-udev-239-40.el8.x86_64                     77/114 
  Running scriptlet: systemd-udev-239-40.el8.x86_64                     77/114 
  Cleanup          : iptables-1.8.4-15.el8.x86_64                       78/114 
  Running scriptlet: iptables-1.8.4-15.el8.x86_64                       78/114 
  Cleanup          : kernel-tools-4.18.0-240.el8.x86_64                 79/114 
  Cleanup          : python3-libselinux-2.9-3.el8.x86_64                80/114 
  Cleanup          : libselinux-utils-2.9-3.el8.x86_64                  81/114 
  Cleanup          : grub2-tools-minimal-1:2.02-90.el8.x86_64           82/114 
  Cleanup          : sudo-1.8.29-6.el8.x86_64                           83/114 
  Cleanup          : NetworkManager-team-1:1.26.0-8.el8.x86_64          84/114 
  Cleanup          : grub2-common-1:2.02-90.el8.noarch                  85/114 
  Cleanup          : selinux-policy-3.14.3-54.el8.noarch                86/114 
  Running scriptlet: selinux-policy-3.14.3-54.el8.noarch                86/114 
  Cleanup          : tzdata-2020d-1.el8.noarch                          87/114 
  Cleanup          : linux-firmware-20200619-99.git3890db36.el8.noar    88/114 
  Cleanup          : iwl7260-firmware-1:25.30.13.0-99.el8.1.noarch      89/114 
  Cleanup          : iwl6050-firmware-41.28.5.1-99.el8.1.noarch         90/114 
  Cleanup          : iwl6000g2a-firmware-18.168.6.1-99.el8.1.noarch     91/114 
  Cleanup          : iwl6000-firmware-9.221.4.1-99.el8.1.noarch         92/114 
  Cleanup          : iwl5150-firmware-8.24.2.2-99.el8.1.noarch          93/114 
  Cleanup          : iwl5000-firmware-8.83.5.1_1-99.el8.1.noarch        94/114 
  Cleanup          : iwl3160-firmware-1:25.30.13.0-99.el8.1.noarch      95/114 
  Cleanup          : iwl2030-firmware-18.168.6.1-99.el8.1.noarch        96/114 
  Cleanup          : iwl2000-firmware-18.168.6.1-99.el8.1.noarch        97/114 
  Cleanup          : iwl135-firmware-18.168.6.1-99.el8.1.noarch         98/114 
  Cleanup          : iwl105-firmware-18.168.6.1-99.el8.1.noarch         99/114 
  Cleanup          : iwl1000-firmware-1:39.31.5.1-99.el8.1.noarch      100/114 
  Cleanup          : iwl100-firmware-39.31.5.1-99.el8.1.noarch         101/114 
  Running scriptlet: NetworkManager-1:1.26.0-8.el8.x86_64              102/114 
  Cleanup          : NetworkManager-1:1.26.0-8.el8.x86_64              102/114 
  Running scriptlet: NetworkManager-1:1.26.0-8.el8.x86_64              102/114 
  Cleanup          : libcurl-7.61.1-14.el8.x86_64                      103/114 
  Running scriptlet: systemd-239-40.el8.x86_64                         104/114 
  Cleanup          : systemd-239-40.el8.x86_64                         104/114 
  Cleanup          : NetworkManager-libnm-1:1.26.0-8.el8.x86_64        105/114 
  Running scriptlet: NetworkManager-libnm-1:1.26.0-8.el8.x86_64        105/114 
  Cleanup          : gnutls-3.6.14-6.el8.x86_64                        106/114 
  Cleanup          : systemd-libs-239-40.el8.x86_64                    107/114 
  Cleanup          : iptables-libs-1.8.4-15.el8.x86_64                 108/114 
  Cleanup          : libselinux-2.9-3.el8.x86_64                       109/114 
  Cleanup          : systemd-pam-239-40.el8.x86_64                     110/114 
  Cleanup          : openssl-libs-1:1.1.1g-11.el8.x86_64               111/114 
  Running scriptlet: openssl-libs-1:1.1.1g-11.el8.x86_64               111/114 
  Cleanup          : kernel-tools-libs-4.18.0-240.el8.x86_64           112/114 
  Running scriptlet: kernel-tools-libs-4.18.0-240.el8.x86_64           112/114 
  Cleanup          : freetype-2.9.1-4.el8.x86_64                       113/114 
  Cleanup          : python3-perf-4.18.0-240.el8.x86_64                114/114 
  Running scriptlet: kernel-core-4.18.0-240.15.1.el8_3.x86_64          114/114 
  Running scriptlet: tuned-2.14.0-3.el8_3.1.noarch                     114/114 
  Running scriptlet: microcode_ctl-4:20200609-2.20210216.1.el8_3.x86   114/114 
  Running scriptlet: python3-perf-4.18.0-240.el8.x86_64                114/114 
  Running scriptlet: systemd-239-41.el8_3.1.x86_64                     114/114 
  Running scriptlet: systemd-udev-239-41.el8_3.1.x86_64                114/114 
  Verifying        : grub2-tools-efi-1:2.02-90.el8_3.1.x86_64            1/114 
  Verifying        : kernel-4.18.0-240.15.1.el8_3.x86_64                 2/114 
  Verifying        : kernel-core-4.18.0-240.15.1.el8_3.x86_64            3/114 
  Verifying        : kernel-modules-4.18.0-240.15.1.el8_3.x86_64         4/114 
  Verifying        : NetworkManager-1:1.26.0-12.el8_3.x86_64             5/114 
  Verifying        : NetworkManager-1:1.26.0-8.el8.x86_64                6/114 
  Verifying        : NetworkManager-libnm-1:1.26.0-12.el8_3.x86_64       7/114 
  Verifying        : NetworkManager-libnm-1:1.26.0-8.el8.x86_64          8/114 
  Verifying        : NetworkManager-team-1:1.26.0-12.el8_3.x86_64        9/114 
  Verifying        : NetworkManager-team-1:1.26.0-8.el8.x86_64          10/114 
  Verifying        : NetworkManager-tui-1:1.26.0-12.el8_3.x86_64        11/114 
  Verifying        : NetworkManager-tui-1:1.26.0-8.el8.x86_64           12/114 
  Verifying        : bind-export-libs-32:9.11.20-5.el8_3.1.x86_64       13/114 
  Verifying        : bind-export-libs-32:9.11.20-5.el8.x86_64           14/114 
  Verifying        : curl-7.61.1-14.el8_3.1.x86_64                      15/114 
  Verifying        : curl-7.61.1-14.el8.x86_64                          16/114 
  Verifying        : dracut-049-95.git20200804.el8_3.4.x86_64           17/114 
  Verifying        : dracut-049-95.git20200804.el8.x86_64               18/114 
  Verifying        : dracut-config-rescue-049-95.git20200804.el8_3.4    19/114 
  Verifying        : dracut-config-rescue-049-95.git20200804.el8.x86    20/114 
  Verifying        : dracut-network-049-95.git20200804.el8_3.4.x86_6    21/114 
  Verifying        : dracut-network-049-95.git20200804.el8.x86_64       22/114 
  Verifying        : dracut-squash-049-95.git20200804.el8_3.4.x86_64    23/114 
  Verifying        : dracut-squash-049-95.git20200804.el8.x86_64        24/114 
  Verifying        : freetype-2.9.1-4.el8_3.1.x86_64                    25/114 
  Verifying        : freetype-2.9.1-4.el8.x86_64                        26/114 
  Verifying        : gnutls-3.6.14-7.el8_3.x86_64                       27/114 
  Verifying        : gnutls-3.6.14-6.el8.x86_64                         28/114 
  Verifying        : grub2-common-1:2.02-90.el8_3.1.noarch              29/114 
  Verifying        : grub2-common-1:2.02-90.el8.noarch                  30/114 
  Verifying        : grub2-pc-1:2.02-90.el8_3.1.x86_64                  31/114 
  Verifying        : grub2-pc-1:2.02-90.el8.x86_64                      32/114 
  Verifying        : grub2-pc-modules-1:2.02-90.el8_3.1.noarch          33/114 
  Verifying        : grub2-pc-modules-1:2.02-90.el8.noarch              34/114 
  Verifying        : grub2-tools-1:2.02-90.el8_3.1.x86_64               35/114 
  Verifying        : grub2-tools-1:2.02-90.el8.x86_64                   36/114 
  Verifying        : grub2-tools-extra-1:2.02-90.el8_3.1.x86_64         37/114 
  Verifying        : grub2-tools-extra-1:2.02-90.el8.x86_64             38/114 
  Verifying        : grub2-tools-minimal-1:2.02-90.el8_3.1.x86_64       39/114 
  Verifying        : grub2-tools-minimal-1:2.02-90.el8.x86_64           40/114 
  Verifying        : iptables-1.8.4-15.el8_3.3.x86_64                   41/114 
  Verifying        : iptables-1.8.4-15.el8.x86_64                       42/114 
  Verifying        : iptables-ebtables-1.8.4-15.el8_3.3.x86_64          43/114 
  Verifying        : iptables-ebtables-1.8.4-15.el8.x86_64              44/114 
  Verifying        : iptables-libs-1.8.4-15.el8_3.3.x86_64              45/114 
  Verifying        : iptables-libs-1.8.4-15.el8.x86_64                  46/114 
  Verifying        : iwl100-firmware-39.31.5.1-101.el8_3.1.noarch       47/114 
  Verifying        : iwl100-firmware-39.31.5.1-99.el8.1.noarch          48/114 
  Verifying        : iwl1000-firmware-1:39.31.5.1-101.el8_3.1.noarch    49/114 
  Verifying        : iwl1000-firmware-1:39.31.5.1-99.el8.1.noarch       50/114 
  Verifying        : iwl105-firmware-18.168.6.1-101.el8_3.1.noarch      51/114 
  Verifying        : iwl105-firmware-18.168.6.1-99.el8.1.noarch         52/114 
  Verifying        : iwl135-firmware-18.168.6.1-101.el8_3.1.noarch      53/114 
  Verifying        : iwl135-firmware-18.168.6.1-99.el8.1.noarch         54/114 
  Verifying        : iwl2000-firmware-18.168.6.1-101.el8_3.1.noarch     55/114 
  Verifying        : iwl2000-firmware-18.168.6.1-99.el8.1.noarch        56/114 
  Verifying        : iwl2030-firmware-18.168.6.1-101.el8_3.1.noarch     57/114 
  Verifying        : iwl2030-firmware-18.168.6.1-99.el8.1.noarch        58/114 
  Verifying        : iwl3160-firmware-1:25.30.13.0-101.el8_3.1.noarc    59/114 
  Verifying        : iwl3160-firmware-1:25.30.13.0-99.el8.1.noarch      60/114 
  Verifying        : iwl5000-firmware-8.83.5.1_1-101.el8_3.1.noarch     61/114 
  Verifying        : iwl5000-firmware-8.83.5.1_1-99.el8.1.noarch        62/114 
  Verifying        : iwl5150-firmware-8.24.2.2-101.el8_3.1.noarch       63/114 
  Verifying        : iwl5150-firmware-8.24.2.2-99.el8.1.noarch          64/114 
  Verifying        : iwl6000-firmware-9.221.4.1-101.el8_3.1.noarch      65/114 
  Verifying        : iwl6000-firmware-9.221.4.1-99.el8.1.noarch         66/114 
  Verifying        : iwl6000g2a-firmware-18.168.6.1-101.el8_3.1.noar    67/114 
  Verifying        : iwl6000g2a-firmware-18.168.6.1-99.el8.1.noarch     68/114 
  Verifying        : iwl6050-firmware-41.28.5.1-101.el8_3.1.noarch      69/114 
  Verifying        : iwl6050-firmware-41.28.5.1-99.el8.1.noarch         70/114 
  Verifying        : iwl7260-firmware-1:25.30.13.0-101.el8_3.1.noarc    71/114 
  Verifying        : iwl7260-firmware-1:25.30.13.0-99.el8.1.noarch      72/114 
  Verifying        : kernel-tools-4.18.0-240.15.1.el8_3.x86_64          73/114 
  Verifying        : kernel-tools-4.18.0-240.el8.x86_64                 74/114 
  Verifying        : kernel-tools-libs-4.18.0-240.15.1.el8_3.x86_64     75/114 
  Verifying        : kernel-tools-libs-4.18.0-240.el8.x86_64            76/114 
  Verifying        : kexec-tools-2.0.20-34.el8_3.1.x86_64               77/114 
  Verifying        : kexec-tools-2.0.20-34.el8.x86_64                   78/114 
  Verifying        : libcurl-7.61.1-14.el8_3.1.x86_64                   79/114 
  Verifying        : libcurl-7.61.1-14.el8.x86_64                       80/114 
  Verifying        : libselinux-2.9-4.el8_3.x86_64                      81/114 
  Verifying        : libselinux-2.9-3.el8.x86_64                        82/114 
  Verifying        : libselinux-utils-2.9-4.el8_3.x86_64                83/114 
  Verifying        : libselinux-utils-2.9-3.el8.x86_64                  84/114 
  Verifying        : linux-firmware-20200619-101.git3890db36.el8_3.n    85/114 
  Verifying        : linux-firmware-20200619-99.git3890db36.el8.noar    86/114 
  Verifying        : microcode_ctl-4:20200609-2.20210216.1.el8_3.x86    87/114 
  Verifying        : microcode_ctl-4:20200609-2.el8.x86_64              88/114 
  Verifying        : openssl-1:1.1.1g-12.el8_3.x86_64                   89/114 
  Verifying        : openssl-1:1.1.1g-11.el8.x86_64                     90/114 
  Verifying        : openssl-libs-1:1.1.1g-12.el8_3.x86_64              91/114 
  Verifying        : openssl-libs-1:1.1.1g-11.el8.x86_64                92/114 
  Verifying        : python3-libselinux-2.9-4.el8_3.x86_64              93/114 
  Verifying        : python3-libselinux-2.9-3.el8.x86_64                94/114 
  Verifying        : python3-perf-4.18.0-240.15.1.el8_3.x86_64          95/114 
  Verifying        : python3-perf-4.18.0-240.el8.x86_64                 96/114 
  Verifying        : selinux-policy-3.14.3-54.el8_3.2.noarch            97/114 
  Verifying        : selinux-policy-3.14.3-54.el8.noarch                98/114 
  Verifying        : selinux-policy-targeted-3.14.3-54.el8_3.2.noarc    99/114 
  Verifying        : selinux-policy-targeted-3.14.3-54.el8.noarch      100/114 
  Verifying        : sudo-1.8.29-6.el8_3.1.x86_64                      101/114 
  Verifying        : sudo-1.8.29-6.el8.x86_64                          102/114 
  Verifying        : systemd-239-41.el8_3.1.x86_64                     103/114 
  Verifying        : systemd-239-40.el8.x86_64                         104/114 
  Verifying        : systemd-libs-239-41.el8_3.1.x86_64                105/114 
  Verifying        : systemd-libs-239-40.el8.x86_64                    106/114 
  Verifying        : systemd-pam-239-41.el8_3.1.x86_64                 107/114 
  Verifying        : systemd-pam-239-40.el8.x86_64                     108/114 
  Verifying        : systemd-udev-239-41.el8_3.1.x86_64                109/114 
  Verifying        : systemd-udev-239-40.el8.x86_64                    110/114 
  Verifying        : tuned-2.14.0-3.el8_3.1.noarch                     111/114 
  Verifying        : tuned-2.14.0-3.el8.noarch                         112/114 
  Verifying        : tzdata-2021a-1.el8.noarch                         113/114 
  Verifying        : tzdata-2020d-1.el8.noarch                         114/114 

Upgraded:
  NetworkManager-1:1.26.0-12.el8_3.x86_64                                      
  NetworkManager-libnm-1:1.26.0-12.el8_3.x86_64                                
  NetworkManager-team-1:1.26.0-12.el8_3.x86_64                                 
  NetworkManager-tui-1:1.26.0-12.el8_3.x86_64                                  
  bind-export-libs-32:9.11.20-5.el8_3.1.x86_64                                 
  curl-7.61.1-14.el8_3.1.x86_64                                                
  dracut-049-95.git20200804.el8_3.4.x86_64                                     
  dracut-config-rescue-049-95.git20200804.el8_3.4.x86_64                       
  dracut-network-049-95.git20200804.el8_3.4.x86_64                             
  dracut-squash-049-95.git20200804.el8_3.4.x86_64                              
  freetype-2.9.1-4.el8_3.1.x86_64                                              
  gnutls-3.6.14-7.el8_3.x86_64                                                 
  grub2-common-1:2.02-90.el8_3.1.noarch                                        
  grub2-pc-1:2.02-90.el8_3.1.x86_64                                            
  grub2-pc-modules-1:2.02-90.el8_3.1.noarch                                    
  grub2-tools-1:2.02-90.el8_3.1.x86_64                                         
  grub2-tools-extra-1:2.02-90.el8_3.1.x86_64                                   
  grub2-tools-minimal-1:2.02-90.el8_3.1.x86_64                                 
  iptables-1.8.4-15.el8_3.3.x86_64                                             
  iptables-ebtables-1.8.4-15.el8_3.3.x86_64                                    
  iptables-libs-1.8.4-15.el8_3.3.x86_64                                        
  iwl100-firmware-39.31.5.1-101.el8_3.1.noarch                                 
  iwl1000-firmware-1:39.31.5.1-101.el8_3.1.noarch                              
  iwl105-firmware-18.168.6.1-101.el8_3.1.noarch                                
  iwl135-firmware-18.168.6.1-101.el8_3.1.noarch                                
  iwl2000-firmware-18.168.6.1-101.el8_3.1.noarch                               
  iwl2030-firmware-18.168.6.1-101.el8_3.1.noarch                               
  iwl3160-firmware-1:25.30.13.0-101.el8_3.1.noarch                             
  iwl5000-firmware-8.83.5.1_1-101.el8_3.1.noarch                               
  iwl5150-firmware-8.24.2.2-101.el8_3.1.noarch                                 
  iwl6000-firmware-9.221.4.1-101.el8_3.1.noarch                                
  iwl6000g2a-firmware-18.168.6.1-101.el8_3.1.noarch                            
  iwl6050-firmware-41.28.5.1-101.el8_3.1.noarch                                
  iwl7260-firmware-1:25.30.13.0-101.el8_3.1.noarch                             
  kernel-tools-4.18.0-240.15.1.el8_3.x86_64                                    
  kernel-tools-libs-4.18.0-240.15.1.el8_3.x86_64                               
  kexec-tools-2.0.20-34.el8_3.1.x86_64                                         
  libcurl-7.61.1-14.el8_3.1.x86_64                                             
  libselinux-2.9-4.el8_3.x86_64                                                
  libselinux-utils-2.9-4.el8_3.x86_64                                          
  linux-firmware-20200619-101.git3890db36.el8_3.noarch                         
  microcode_ctl-4:20200609-2.20210216.1.el8_3.x86_64                           
  openssl-1:1.1.1g-12.el8_3.x86_64                                             
  openssl-libs-1:1.1.1g-12.el8_3.x86_64                                        
  python3-libselinux-2.9-4.el8_3.x86_64                                        
  python3-perf-4.18.0-240.15.1.el8_3.x86_64                                    
  selinux-policy-3.14.3-54.el8_3.2.noarch                                      
  selinux-policy-targeted-3.14.3-54.el8_3.2.noarch                             
  sudo-1.8.29-6.el8_3.1.x86_64                                                 
  systemd-239-41.el8_3.1.x86_64                                                
  systemd-libs-239-41.el8_3.1.x86_64                                           
  systemd-pam-239-41.el8_3.1.x86_64                                            
  systemd-udev-239-41.el8_3.1.x86_64                                           
  tuned-2.14.0-3.el8_3.1.noarch                                                
  tzdata-2021a-1.el8.noarch                                                    

Installed:
  grub2-tools-efi-1:2.02-90.el8_3.1.x86_64                                     
  kernel-4.18.0-240.15.1.el8_3.x86_64                                          
  kernel-core-4.18.0-240.15.1.el8_3.x86_64                                     
  kernel-modules-4.18.0-240.15.1.el8_3.x86_64                                  

Complete!
[root@mysql8 yum.repos.d]# 

安装数据库

yum install mysql-server
  • 效果如下

    [root@mysql8 yum.repos.d]# yum install mysql-server
    Last metadata expiration check: 0:17:05 ago on Fri 26 Mar 2021 04:28:46 PM CST.
    Dependencies resolved.
    ===============================================================================
     Package                      Arch   Version                   Repo       Size
    ===============================================================================
    Installing:
     mysql-server                 x86_64 8.0.21-1.module_el8.2.0+493+63b41e36
                                                                   AppStream  22 M
    Installing dependencies:
     checkpolicy                  x86_64 2.9-1.el8                 base      348 k
     mariadb-connector-c-config   noarch 3.1.11-2.el8_3            AppStream  15 k
     mecab                        x86_64 0.996-1.module_el8.2.0+493+63b41e36.9
                                                                   AppStream 393 k
     mysql                        x86_64 8.0.21-1.module_el8.2.0+493+63b41e36
                                                                   AppStream  12 M
     mysql-common                 x86_64 8.0.21-1.module_el8.2.0+493+63b41e36
                                                                   AppStream 148 k
     mysql-errmsg                 x86_64 8.0.21-1.module_el8.2.0+493+63b41e36
                                                                   AppStream 581 k
     perl-Carp                    noarch 1.42-396.el8              base       30 k
     perl-Data-Dumper             x86_64 2.167-399.el8             base       58 k
     perl-Digest                  noarch 1.17-395.el8              AppStream  27 k
     perl-Digest-MD5              x86_64 2.55-396.el8              AppStream  37 k
     perl-Encode                  x86_64 4:2.97-3.el8              base      1.5 M
     perl-Errno                   x86_64 1.28-416.el8              base       76 k
     perl-Exporter                noarch 5.72-396.el8              base       34 k
     perl-File-Path               noarch 2.15-2.el8                base       38 k
     perl-File-Temp               noarch 0.230.600-1.el8           base       63 k
     perl-Getopt-Long             noarch 1:2.50-4.el8              base       63 k
     perl-HTTP-Tiny               noarch 0.074-1.el8               base       58 k
     perl-IO                      x86_64 1.38-416.el8              base      141 k
     perl-MIME-Base64             x86_64 3.15-396.el8              base       31 k
     perl-Net-SSLeay              x86_64 1.88-1.module_el8.3.0+410+ff426aa3
                                                                   AppStream 379 k
     perl-PathTools               x86_64 3.74-1.el8                base       90 k
     perl-Pod-Escapes             noarch 1:1.07-395.el8            base       20 k
     perl-Pod-Perldoc             noarch 3.28-396.el8              base       86 k
     perl-Pod-Simple              noarch 1:3.35-395.el8            base      213 k
     perl-Pod-Usage               noarch 4:1.69-395.el8            base       34 k
     perl-Scalar-List-Utils       x86_64 3:1.49-2.el8              base       68 k
     perl-Socket                  x86_64 4:2.027-3.el8             base       59 k
     perl-Storable                x86_64 1:3.11-3.el8              base       98 k
     perl-Term-ANSIColor          noarch 4.06-396.el8              base       46 k
     perl-Term-Cap                noarch 1.17-395.el8              base       23 k
     perl-Text-ParseWords         noarch 3.30-395.el8              base       18 k
     perl-Text-Tabs+Wrap          noarch 2013.0523-395.el8         base       24 k
     perl-Time-Local              noarch 1:1.280-1.el8             base       34 k
     perl-URI                     noarch 1.73-3.el8                AppStream 116 k
     perl-Unicode-Normalize       x86_64 1.25-396.el8              base       82 k
     perl-constant                noarch 1.33-396.el8              base       25 k
     perl-interpreter             x86_64 4:5.26.3-416.el8          base      6.3 M
     perl-libnet                  noarch 3.11-3.el8                AppStream 121 k
     perl-libs                    x86_64 4:5.26.3-416.el8          base      1.6 M
     perl-macros                  x86_64 4:5.26.3-416.el8          base       72 k
     perl-parent                  noarch 1:0.237-1.el8             base       20 k
     perl-podlators               noarch 4.11-1.el8                base      118 k
     perl-threads                 x86_64 1:2.21-2.el8              base       61 k
     perl-threads-shared          x86_64 1.58-2.el8                base       48 k
     policycoreutils-python-utils noarch 2.9-9.el8                 base      251 k
     protobuf-lite                x86_64 3.5.0-13.el8              AppStream 149 k
     python3-audit                x86_64 3.0-0.17.20191104git1c2f876.el8
                                                                   base       86 k
     python3-libsemanage          x86_64 2.9-3.el8                 base      127 k
     python3-policycoreutils      noarch 2.9-9.el8                 base      2.2 M
     python3-setools              x86_64 4.3.0-2.el8               base      626 k
    Installing weak dependencies:
     perl-IO-Socket-IP            noarch 0.39-5.el8                AppStream  47 k
     perl-IO-Socket-SSL           noarch 2.066-4.module_el8.3.0+410+ff426aa3
                                                                   AppStream 298 k
     perl-Mozilla-CA              noarch 20160104-7.module_el8.3.0+416+dee7bcef
                                                                   AppStream  15 k
    Enabling module streams:
     mysql                               8.0                                      
     perl                                5.26                                     
     perl-IO-Socket-SSL                  2.066                                    
     perl-libwww-perl                    6.34                                     
    
    Transaction Summary
    ===============================================================================
    Install  54 Packages
    
    Total download size: 51 M
    Installed size: 228 M
    Is this ok [y/N]: y
    Downloading Packages:
    (1/54): perl-Carp-1.42-396.el8.noarch.rpm      223 kB/s |  30 kB     00:00    
    (2/54): perl-Data-Dumper-2.167-399.el8.x86_64. 305 kB/s |  58 kB     00:00    
    (3/54): perl-Errno-1.28-416.el8.x86_64.rpm     988 kB/s |  76 kB     00:00    
    (4/54): checkpolicy-2.9-1.el8.x86_64.rpm       1.1 MB/s | 348 kB     00:00    
    (5/54): perl-Exporter-5.72-396.el8.noarch.rpm  940 kB/s |  34 kB     00:00    
    (6/54): perl-File-Temp-0.230.600-1.el8.noarch. 940 kB/s |  63 kB     00:00    
    (7/54): perl-File-Path-2.15-2.el8.noarch.rpm   496 kB/s |  38 kB     00:00    
    (8/54): perl-HTTP-Tiny-0.074-1.el8.noarch.rpm  1.1 MB/s |  58 kB     00:00    
    (9/54): perl-Getopt-Long-2.50-4.el8.noarch.rpm 763 kB/s |  63 kB     00:00    
    (10/54): perl-Encode-2.97-3.el8.x86_64.rpm     4.5 MB/s | 1.5 MB     00:00    
    (11/54): perl-IO-1.38-416.el8.x86_64.rpm       1.8 MB/s | 141 kB     00:00    
    (12/54): perl-PathTools-3.74-1.el8.x86_64.rpm  2.0 MB/s |  90 kB     00:00    
    (13/54): perl-MIME-Base64-3.15-396.el8.x86_64. 522 kB/s |  31 kB     00:00    
    (14/54): perl-Pod-Escapes-1.07-395.el8.noarch. 578 kB/s |  20 kB     00:00    
    (15/54): perl-Pod-Perldoc-3.28-396.el8.noarch. 2.2 MB/s |  86 kB     00:00    
    (16/54): perl-Pod-Usage-1.69-395.el8.noarch.rp 1.5 MB/s |  34 kB     00:00    
    (17/54): perl-Scalar-List-Utils-1.49-2.el8.x86 1.4 MB/s |  68 kB     00:00    
    (18/54): perl-Pod-Simple-3.35-395.el8.noarch.r 1.9 MB/s | 213 kB     00:00    
    (19/54): perl-Socket-2.027-3.el8.x86_64.rpm    919 kB/s |  59 kB     00:00    
    (20/54): perl-Storable-3.11-3.el8.x86_64.rpm   1.8 MB/s |  98 kB     00:00    
    (21/54): perl-Text-ParseWords-3.30-395.el8.noa 613 kB/s |  18 kB     00:00    
    (22/54): perl-Term-ANSIColor-4.06-396.el8.noar 731 kB/s |  46 kB     00:00    
    (23/54): perl-Term-Cap-1.17-395.el8.noarch.rpm 336 kB/s |  23 kB     00:00    
    (24/54): perl-Unicode-Normalize-1.25-396.el8.x 2.2 MB/s |  82 kB     00:00    
    (25/54): perl-Time-Local-1.280-1.el8.noarch.rp 656 kB/s |  34 kB     00:00    
    (26/54): perl-constant-1.33-396.el8.noarch.rpm 494 kB/s |  25 kB     00:00    
    (27/54): perl-Text-Tabs+Wrap-2013.0523-395.el8 159 kB/s |  24 kB     00:00    
    (28/54): perl-macros-5.26.3-416.el8.x86_64.rpm 1.1 MB/s |  72 kB     00:00    
    (29/54): perl-parent-0.237-1.el8.noarch.rpm    252 kB/s |  20 kB     00:00    
    (30/54): perl-podlators-4.11-1.el8.noarch.rpm  1.2 MB/s | 118 kB     00:00    
    (31/54): perl-libs-5.26.3-416.el8.x86_64.rpm   4.6 MB/s | 1.6 MB     00:00    
    (32/54): perl-threads-2.21-2.el8.x86_64.rpm    657 kB/s |  61 kB     00:00    
    (33/54): perl-threads-shared-1.58-2.el8.x86_64 507 kB/s |  48 kB     00:00    
    (34/54): policycoreutils-python-utils-2.9-9.el 3.3 MB/s | 251 kB     00:00    
    (35/54): python3-libsemanage-2.9-3.el8.x86_64. 1.4 MB/s | 127 kB     00:00    
    (36/54): python3-audit-3.0-0.17.20191104git1c2 751 kB/s |  86 kB     00:00    
    (37/54): python3-setools-4.3.0-2.el8.x86_64.rp 2.7 MB/s | 626 kB     00:00    
    (38/54): perl-interpreter-5.26.3-416.el8.x86_6 7.3 MB/s | 6.3 MB     00:00    
    (39/54): mariadb-connector-c-config-3.1.11-2.e 140 kB/s |  15 kB     00:00    
    (40/54): python3-policycoreutils-2.9-9.el8.noa 5.0 MB/s | 2.2 MB     00:00    
    (41/54): mecab-0.996-1.module_el8.2.0+493+63b4 2.2 MB/s | 393 kB     00:00    
    (42/54): mysql-common-8.0.21-1.module_el8.2.0+ 1.1 MB/s | 148 kB     00:00    
    (43/54): mysql-errmsg-8.0.21-1.module_el8.2.0+ 2.7 MB/s | 581 kB     00:00    
    (44/54): perl-Digest-1.17-395.el8.noarch.rpm   702 kB/s |  27 kB     00:00    
    (45/54): perl-Digest-MD5-2.55-396.el8.x86_64.r 271 kB/s |  37 kB     00:00    
    (46/54): perl-IO-Socket-IP-0.39-5.el8.noarch.r 418 kB/s |  47 kB     00:00    
    (47/54): perl-IO-Socket-SSL-2.066-4.module_el8 2.2 MB/s | 298 kB     00:00    
    (48/54): perl-Mozilla-CA-20160104-7.module_el8  92 kB/s |  15 kB     00:00    
    (49/54): perl-Net-SSLeay-1.88-1.module_el8.3.0 2.2 MB/s | 379 kB     00:00    
    (50/54): perl-URI-1.73-3.el8.noarch.rpm        1.1 MB/s | 116 kB     00:00    
    (51/54): perl-libnet-3.11-3.el8.noarch.rpm     953 kB/s | 121 kB     00:00    
    (52/54): protobuf-lite-3.5.0-13.el8.x86_64.rpm 1.1 MB/s | 149 kB     00:00    
    (53/54): mysql-8.0.21-1.module_el8.2.0+493+63b 6.3 MB/s |  12 MB     00:01    
    (54/54): mysql-server-8.0.21-1.module_el8.2.0+ 8.0 MB/s |  22 MB     00:02    
    -------------------------------------------------------------------------------
    Total                                           11 MB/s |  51 MB     00:04     
    Running transaction check
    Transaction check succeeded.
    Running transaction test
    Transaction test succeeded.
    Running transaction
      Preparing        :                                                       1/1 
      Installing       : perl-Exporter-5.72-396.el8.noarch                    1/54 
      Installing       : perl-libs-4:5.26.3-416.el8.x86_64                    2/54 
      Installing       : perl-Carp-1.42-396.el8.noarch                        3/54 
      Installing       : perl-Scalar-List-Utils-3:1.49-2.el8.x86_64           4/54 
      Installing       : perl-parent-1:0.237-1.el8.noarch                     5/54 
      Installing       : perl-Text-ParseWords-3.30-395.el8.noarch             6/54 
      Installing       : mariadb-connector-c-config-3.1.11-2.el8_3.noarch     7/54 
      Installing       : mysql-common-8.0.21-1.module_el8.2.0+493+63b41e36    8/54 
      Installing       : mysql-8.0.21-1.module_el8.2.0+493+63b41e36.x86_64    9/54 
      Installing       : mysql-errmsg-8.0.21-1.module_el8.2.0+493+63b41e36   10/54 
      Installing       : perl-Term-ANSIColor-4.06-396.el8.noarch             11/54 
      Installing       : perl-macros-4:5.26.3-416.el8.x86_64                 12/54 
      Installing       : perl-Errno-1.28-416.el8.x86_64                      13/54 
      Installing       : perl-Socket-4:2.027-3.el8.x86_64                    14/54 
      Installing       : perl-Text-Tabs+Wrap-2013.0523-395.el8.noarch        15/54 
      Installing       : perl-Unicode-Normalize-1.25-396.el8.x86_64          16/54 
      Installing       : perl-File-Path-2.15-2.el8.noarch                    17/54 
      Installing       : perl-IO-1.38-416.el8.x86_64                         18/54 
      Installing       : perl-PathTools-3.74-1.el8.x86_64                    19/54 
      Installing       : perl-constant-1.33-396.el8.noarch                   20/54 
      Installing       : perl-threads-1:2.21-2.el8.x86_64                    21/54 
      Installing       : perl-threads-shared-1.58-2.el8.x86_64               22/54 
      Installing       : perl-interpreter-4:5.26.3-416.el8.x86_64            23/54 
      Installing       : perl-MIME-Base64-3.15-396.el8.x86_64                24/54 
      Installing       : perl-IO-Socket-IP-0.39-5.el8.noarch                 25/54 
      Installing       : perl-Time-Local-1:1.280-1.el8.noarch                26/54 
      Installing       : perl-Digest-1.17-395.el8.noarch                     27/54 
      Installing       : perl-Digest-MD5-2.55-396.el8.x86_64                 28/54 
      Installing       : perl-Net-SSLeay-1.88-1.module_el8.3.0+410+ff426aa   29/54 
      Installing       : perl-Data-Dumper-2.167-399.el8.x86_64               30/54 
      Installing       : perl-File-Temp-0.230.600-1.el8.noarch               31/54 
      Installing       : perl-Pod-Escapes-1:1.07-395.el8.noarch              32/54 
      Installing       : perl-Storable-1:3.11-3.el8.x86_64                   33/54 
      Installing       : perl-Term-Cap-1.17-395.el8.noarch                   34/54 
      Installing       : perl-Mozilla-CA-20160104-7.module_el8.3.0+416+dee   35/54 
      Installing       : perl-Encode-4:2.97-3.el8.x86_64                     36/54 
      Installing       : perl-Pod-Simple-1:3.35-395.el8.noarch               37/54 
      Installing       : perl-Getopt-Long-1:2.50-4.el8.noarch                38/54 
      Installing       : perl-podlators-4.11-1.el8.noarch                    39/54 
      Installing       : perl-Pod-Usage-4:1.69-395.el8.noarch                40/54 
      Installing       : perl-Pod-Perldoc-3.28-396.el8.noarch                41/54 
      Installing       : perl-HTTP-Tiny-0.074-1.el8.noarch                   42/54 
      Installing       : perl-IO-Socket-SSL-2.066-4.module_el8.3.0+410+ff4   43/54 
      Installing       : perl-libnet-3.11-3.el8.noarch                       44/54 
      Installing       : perl-URI-1.73-3.el8.noarch                          45/54 
      Installing       : protobuf-lite-3.5.0-13.el8.x86_64                   46/54 
      Installing       : mecab-0.996-1.module_el8.2.0+493+63b41e36.9.x86_6   47/54 
      Running scriptlet: mecab-0.996-1.module_el8.2.0+493+63b41e36.9.x86_6   47/54 
      Installing       : python3-setools-4.3.0-2.el8.x86_64                  48/54 
      Installing       : python3-libsemanage-2.9-3.el8.x86_64                49/54 
      Installing       : python3-audit-3.0-0.17.20191104git1c2f876.el8.x86   50/54 
      Installing       : checkpolicy-2.9-1.el8.x86_64                        51/54 
      Installing       : python3-policycoreutils-2.9-9.el8.noarch            52/54 
      Installing       : policycoreutils-python-utils-2.9-9.el8.noarch       53/54 
      Running scriptlet: mysql-server-8.0.21-1.module_el8.2.0+493+63b41e36   54/54 
      Installing       : mysql-server-8.0.21-1.module_el8.2.0+493+63b41e36   54/54 
      Running scriptlet: mysql-server-8.0.21-1.module_el8.2.0+493+63b41e36   54/54 
    ValueError: File context for /var/log/mysql(/.*)? already defined
    
      Verifying        : checkpolicy-2.9-1.el8.x86_64                         1/54 
      Verifying        : perl-Carp-1.42-396.el8.noarch                        2/54 
      Verifying        : perl-Data-Dumper-2.167-399.el8.x86_64                3/54 
      Verifying        : perl-Encode-4:2.97-3.el8.x86_64                      4/54 
      Verifying        : perl-Errno-1.28-416.el8.x86_64                       5/54 
      Verifying        : perl-Exporter-5.72-396.el8.noarch                    6/54 
      Verifying        : perl-File-Path-2.15-2.el8.noarch                     7/54 
      Verifying        : perl-File-Temp-0.230.600-1.el8.noarch                8/54 
      Verifying        : perl-Getopt-Long-1:2.50-4.el8.noarch                 9/54 
      Verifying        : perl-HTTP-Tiny-0.074-1.el8.noarch                   10/54 
      Verifying        : perl-IO-1.38-416.el8.x86_64                         11/54 
      Verifying        : perl-MIME-Base64-3.15-396.el8.x86_64                12/54 
      Verifying        : perl-PathTools-3.74-1.el8.x86_64                    13/54 
      Verifying        : perl-Pod-Escapes-1:1.07-395.el8.noarch              14/54 
      Verifying        : perl-Pod-Perldoc-3.28-396.el8.noarch                15/54 
      Verifying        : perl-Pod-Simple-1:3.35-395.el8.noarch               16/54 
      Verifying        : perl-Pod-Usage-4:1.69-395.el8.noarch                17/54 
      Verifying        : perl-Scalar-List-Utils-3:1.49-2.el8.x86_64          18/54 
      Verifying        : perl-Socket-4:2.027-3.el8.x86_64                    19/54 
      Verifying        : perl-Storable-1:3.11-3.el8.x86_64                   20/54 
      Verifying        : perl-Term-ANSIColor-4.06-396.el8.noarch             21/54 
      Verifying        : perl-Term-Cap-1.17-395.el8.noarch                   22/54 
      Verifying        : perl-Text-ParseWords-3.30-395.el8.noarch            23/54 
      Verifying        : perl-Text-Tabs+Wrap-2013.0523-395.el8.noarch        24/54 
      Verifying        : perl-Time-Local-1:1.280-1.el8.noarch                25/54 
      Verifying        : perl-Unicode-Normalize-1.25-396.el8.x86_64          26/54 
      Verifying        : perl-constant-1.33-396.el8.noarch                   27/54 
      Verifying        : perl-interpreter-4:5.26.3-416.el8.x86_64            28/54 
      Verifying        : perl-libs-4:5.26.3-416.el8.x86_64                   29/54 
      Verifying        : perl-macros-4:5.26.3-416.el8.x86_64                 30/54 
      Verifying        : perl-parent-1:0.237-1.el8.noarch                    31/54 
      Verifying        : perl-podlators-4.11-1.el8.noarch                    32/54 
      Verifying        : perl-threads-1:2.21-2.el8.x86_64                    33/54 
      Verifying        : perl-threads-shared-1.58-2.el8.x86_64               34/54 
      Verifying        : policycoreutils-python-utils-2.9-9.el8.noarch       35/54 
      Verifying        : python3-audit-3.0-0.17.20191104git1c2f876.el8.x86   36/54 
      Verifying        : python3-libsemanage-2.9-3.el8.x86_64                37/54 
      Verifying        : python3-policycoreutils-2.9-9.el8.noarch            38/54 
      Verifying        : python3-setools-4.3.0-2.el8.x86_64                  39/54 
      Verifying        : mariadb-connector-c-config-3.1.11-2.el8_3.noarch    40/54 
      Verifying        : mecab-0.996-1.module_el8.2.0+493+63b41e36.9.x86_6   41/54 
      Verifying        : mysql-8.0.21-1.module_el8.2.0+493+63b41e36.x86_64   42/54 
      Verifying        : mysql-common-8.0.21-1.module_el8.2.0+493+63b41e36   43/54 
      Verifying        : mysql-errmsg-8.0.21-1.module_el8.2.0+493+63b41e36   44/54 
      Verifying        : mysql-server-8.0.21-1.module_el8.2.0+493+63b41e36   45/54 
      Verifying        : perl-Digest-1.17-395.el8.noarch                     46/54 
      Verifying        : perl-Digest-MD5-2.55-396.el8.x86_64                 47/54 
      Verifying        : perl-IO-Socket-IP-0.39-5.el8.noarch                 48/54 
      Verifying        : perl-IO-Socket-SSL-2.066-4.module_el8.3.0+410+ff4   49/54 
      Verifying        : perl-Mozilla-CA-20160104-7.module_el8.3.0+416+dee   50/54 
      Verifying        : perl-Net-SSLeay-1.88-1.module_el8.3.0+410+ff426aa   51/54 
      Verifying        : perl-URI-1.73-3.el8.noarch                          52/54 
      Verifying        : perl-libnet-3.11-3.el8.noarch                       53/54 
      Verifying        : protobuf-lite-3.5.0-13.el8.x86_64                   54/54 
    
    Installed:
      checkpolicy-2.9-1.el8.x86_64                                                 
      mariadb-connector-c-config-3.1.11-2.el8_3.noarch                             
      mecab-0.996-1.module_el8.2.0+493+63b41e36.9.x86_64                           
      mysql-8.0.21-1.module_el8.2.0+493+63b41e36.x86_64                            
      mysql-common-8.0.21-1.module_el8.2.0+493+63b41e36.x86_64                     
      mysql-errmsg-8.0.21-1.module_el8.2.0+493+63b41e36.x86_64                     
      mysql-server-8.0.21-1.module_el8.2.0+493+63b41e36.x86_64                     
      perl-Carp-1.42-396.el8.noarch                                                
      perl-Data-Dumper-2.167-399.el8.x86_64                                        
      perl-Digest-1.17-395.el8.noarch                                              
      perl-Digest-MD5-2.55-396.el8.x86_64                                          
      perl-Encode-4:2.97-3.el8.x86_64                                              
      perl-Errno-1.28-416.el8.x86_64                                               
      perl-Exporter-5.72-396.el8.noarch                                            
      perl-File-Path-2.15-2.el8.noarch                                             
      perl-File-Temp-0.230.600-1.el8.noarch                                        
      perl-Getopt-Long-1:2.50-4.el8.noarch                                         
      perl-HTTP-Tiny-0.074-1.el8.noarch                                            
      perl-IO-1.38-416.el8.x86_64                                                  
      perl-IO-Socket-IP-0.39-5.el8.noarch                                          
      perl-IO-Socket-SSL-2.066-4.module_el8.3.0+410+ff426aa3.noarch                
      perl-MIME-Base64-3.15-396.el8.x86_64                                         
      perl-Mozilla-CA-20160104-7.module_el8.3.0+416+dee7bcef.noarch                
      perl-Net-SSLeay-1.88-1.module_el8.3.0+410+ff426aa3.x86_64                    
      perl-PathTools-3.74-1.el8.x86_64                                             
      perl-Pod-Escapes-1:1.07-395.el8.noarch                                       
      perl-Pod-Perldoc-3.28-396.el8.noarch                                         
      perl-Pod-Simple-1:3.35-395.el8.noarch                                        
      perl-Pod-Usage-4:1.69-395.el8.noarch                                         
      perl-Scalar-List-Utils-3:1.49-2.el8.x86_64                                   
      perl-Socket-4:2.027-3.el8.x86_64                                             
      perl-Storable-1:3.11-3.el8.x86_64                                            
      perl-Term-ANSIColor-4.06-396.el8.noarch                                      
      perl-Term-Cap-1.17-395.el8.noarch                                            
      perl-Text-ParseWords-3.30-395.el8.noarch                                     
      perl-Text-Tabs+Wrap-2013.0523-395.el8.noarch                                 
      perl-Time-Local-1:1.280-1.el8.noarch                                         
      perl-URI-1.73-3.el8.noarch                                                   
      perl-Unicode-Normalize-1.25-396.el8.x86_64                                   
      perl-constant-1.33-396.el8.noarch                                            
      perl-interpreter-4:5.26.3-416.el8.x86_64                                     
      perl-libnet-3.11-3.el8.noarch                                                
      perl-libs-4:5.26.3-416.el8.x86_64                                            
      perl-macros-4:5.26.3-416.el8.x86_64                                          
      perl-parent-1:0.237-1.el8.noarch                                             
      perl-podlators-4.11-1.el8.noarch                                             
      perl-threads-1:2.21-2.el8.x86_64                                             
      perl-threads-shared-1.58-2.el8.x86_64                                        
      policycoreutils-python-utils-2.9-9.el8.noarch                                
      protobuf-lite-3.5.0-13.el8.x86_64                                            
      python3-audit-3.0-0.17.20191104git1c2f876.el8.x86_64                         
      python3-libsemanage-2.9-3.el8.x86_64                                         
      python3-policycoreutils-2.9-9.el8.noarch                                     
      python3-setools-4.3.0-2.el8.x86_64                                           
    
    Complete!
    [root@mysql8 yum.repos.d]#
    

设置权限

设置权限:chown mysql:mysql -R /var/lib/mysql
授权 chmod -R 777 /var/lib/mysql

初始化并启动mysql

初始化 MySQL:mysqld --initialize
启动 MySQL:systemctl start mysqld

查看mysql运行状态

查看 MySQL 运行状态:systemctl status mysqld

查询默认密码

  • grep 'password' /var/log/mysql/mysqld.log |head -n1
[root@mysql8 lib]# grep 'password' /var/log/mysql/mysqld.log |head -n1
2021-03-26T08:51:43.543990Z 6 [Note] [MY-010454] [Server] A temporary password is generated for root@localhost: sE/ic7wJE;.0
[root@mysql8 lib]# 

查看版本

[root@mysql8 lib]# mysqladmin --version
mysqladmin  Ver 8.0.21 for Linux on x86_64 (Source distribution)
[root@mysql8 lib]# 

修改密码

  • 首次登陆需要修改密码
[root@mysql8 lib]# mysql -u root -p
Enter password: 
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 9
Server version: 8.0.21

Copyright (c) 2000, 2020, Oracle and/or its affiliates. All rights reserved.

Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

mysql> show databases;
ERROR 1820 (HY000): You must reset your password using ALTER USER statement before executing this statement.
mysql> alter user 'root'@'localhost' IDENTIFIED BY 'root';
Query OK, 0 rows affected (0.00 sec)

mysql> flush privileges;
Query OK, 0 rows affected (0.00 sec)

mysql> exit
Bye
[root@mysql8 lib]#

设置开机启动

[root@mysql8 lib]# systemctl enable mysqld
Created symlink /etc/systemd/system/multi-user.target.wants/mysqld.service → /usr/lib/systemd/system/mysqld.service.
[root@mysql8 lib]#

安装过程的问题排查

安装后启动失败

[root@mysql8 lib]# 
[root@mysql8 lib]# systemctl start mysqld
Job for mysqld.service failed because the control process exited with error code.
See "systemctl status mysqld.service" and "journalctl -xe" for details.
[root@mysql8 lib]# 

查看mysql日志

tail -f /var/log/mysql/mysqld.log

2021-03-26T08:57:29.561689Z 0 [System] [MY-010116] [Server] /usr/libexec/mysqld (mysqld 8.0.21) starting as process 42188
2021-03-26T08:57:29.569019Z 1 [System] [MY-013576] [InnoDB] InnoDB initialization has started.
2021-03-26T08:57:29.569173Z 1 [ERROR] [MY-012271] [InnoDB] The innodb_system data file 'ibdata1' must be writable
2021-03-26T08:57:29.569273Z 1 [ERROR] [MY-012278] [InnoDB] The innodb_system data file 'ibdata1' must be writable
2021-03-26T08:57:29.569373Z 1 [ERROR] [MY-010334] [Server] Failed to initialize DD Storage Engine
2021-03-26T08:57:29.569611Z 0 [ERROR] [MY-010020] [Server] Data Dictionary initialization failed.
2021-03-26T08:57:29.569740Z 0 [ERROR] [MY-010119] [Server] Aborting
2021-03-26T08:57:29.570317Z 0 [System] [MY-010910] [Server] /usr/libexec/mysqld: Shutdown complete (mysqld 8.0.21)  Source distribution.

解决方案
chmod -R 777 /var/lib/mysql