Centos8/Redhat8安装Mysql8.0.31

在CentOS系统中,通过下载MySQL的RPM安装包,使用YUM命令进行安装。安装过程中涉及了依赖包的升级和降级。然后通过编辑my.cnf文件,重启mysqld服务来忘记root密码。接着在MySQL命令行中更新用户表,清空root用户的认证字符串,再设置新的root密码,并刷新权限。
摘要由CSDN通过智能技术生成

1、下载MySQL rpm安装包

下载地址,下面可以选择你得系统版本
在这里插入图片描述

[root@220-230 src]# ls			#共下载如下12个rpm包
mysql-community-client-8.0.31-1.el7.x86_64.rpm           mysql-community-icu-data-files-8.0.31-1.el7.x86_64.rpm
mysql-community-client-plugins-8.0.31-1.el7.x86_64.rpm   mysql-community-libs-8.0.31-1.el7.x86_64.rpm
mysql-community-common-8.0.31-1.el7.x86_64.rpm           mysql-community-libs-compat-8.0.31-1.el7.x86_64.rpm
mysql-community-debuginfo-8.0.31-1.el7.x86_64.rpm        mysql-community-server-8.0.31-1.el7.x86_64.rpm
mysql-community-devel-8.0.31-1.el7.x86_64.rpm            mysql-community-server-debug-8.0.31-1.el7.x86_64.rpm
mysql-community-embedded-compat-8.0.31-1.el7.x86_64.rpm  mysql-community-test-8.0.31-1.el7.x86_64.rpm
[root@220-230 src]# yum install * -y  #安装
[root@220-230 src]# yum install *
CentOS-8.5.2111 - Base - mirrors.aliyun.com                                                            57 kB/s | 3.9 kB     00:00    
Dependencies resolved.
======================================================================================================================================
 Package                                  Architecture    Version                                         Repository             Size
======================================================================================================================================
Installing:
 mysql-community-client                   x86_64          8.0.31-1.el7                                    @commandline           16 M
 mysql-community-client-plugins           x86_64          8.0.31-1.el7                                    @commandline          2.5 M
 mysql-community-common                   x86_64          8.0.31-1.el7                                    @commandline          647 k
 mysql-community-debuginfo                x86_64          8.0.31-1.el7                                    @commandline          484 M
 mysql-community-devel                    x86_64          8.0.31-1.el7                                    @commandline          1.9 M
 mysql-community-embedded-compat          x86_64          8.0.31-1.el7                                    @commandline          4.0 M
 mysql-community-icu-data-files           x86_64          8.0.31-1.el7                                    @commandline          2.1 M
 mysql-community-libs                     x86_64          8.0.31-1.el7                                    @commandline          1.5 M
 mysql-community-libs-compat              x86_64          8.0.31-1.el7                                    @commandline          670 k
 mysql-community-server                   x86_64          8.0.31-1.el7                                    @commandline           64 M
 mysql-community-server-debug             x86_64          8.0.31-1.el7                                    @commandline           24 M
 mysql-community-test                     x86_64          8.0.31-1.el7                                    @commandline          263 M
Installing dependencies:
 compat-openssl10                         x86_64          1:1.0.2o-3.el8                                  AppStream             1.1 M
 keyutils-libs-devel                      x86_64          1.5.10-9.el8                                    base                   48 k
 krb5-devel                               x86_64          1.18.2-14.el8                                   base                  560 k
 libcom_err-devel                         x86_64          1.45.6-2.el8                                    base                   38 k
 libkadm5                                 x86_64          1.18.2-14.el8                                   base                  187 k
 libselinux-devel                         x86_64          2.9-5.el8                                       base                  200 k
 libsepol-devel                           x86_64          2.9-3.el8                                       base                   87 k
 libverto-devel                           x86_64          0.3.0-5.el8                                     base                   18 k
 make                                     x86_64          1:4.2.1-10.el8                                  base                  498 k
 ncurses-compat-libs                      x86_64          6.1-9.20180224.el8                              base                  328 k
 openssl-devel                            x86_64          1:1.1.1k-5.el8_5                                base                  2.3 M
 pcre2-devel                              x86_64          10.32-2.el8                                     base                  605 k
 pcre2-utf16                              x86_64          10.32-2.el8                                     base                  229 k
 pcre2-utf32                              x86_64          10.32-2.el8                                     base                  220 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-420.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-420.el8                                    base                  142 k
 perl-JSON                                noarch          2.97.001-2.el8                                  AppStream              96 k
 perl-MIME-Base64                         x86_64          3.15-396.el8                                    base                   31 k
 perl-Memoize                             noarch          1.03-420.el8                                    AppStream             118 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-Test-Simple                         noarch          1:1.302135-1.el8                                AppStream             516 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-HiRes                          x86_64          4:1.9758-2.el8                                  AppStream              61 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-420.el8                                base                  6.3 M
 perl-libnet                              noarch          3.11-3.el8                                      AppStream             121 k
 perl-libs                                x86_64          4:5.26.3-420.el8                                base                  1.6 M
 perl-macros                              x86_64          4:5.26.3-420.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
 zlib-devel                               x86_64          1.2.11-17.el8                                   base                   58 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
Downgrading:
 e2fsprogs                                x86_64          1.45.6-2.el8                                    base                  1.0 M
 e2fsprogs-libs                           x86_64          1.45.6-2.el8                                    base                  233 k
 krb5-libs                                x86_64          1.18.2-14.el8                                   base                  840 k
 libcom_err                               x86_64          1.45.6-2.el8                                    base                   49 k
 libselinux                               x86_64          2.9-5.el8                                       base                  165 k
 libselinux-utils                         x86_64          2.9-5.el8                                       base                  243 k
 libss                                    x86_64          1.45.6-2.el8                                    base                   54 k
 libverto                                 x86_64          0.3.0-5.el8                                     base                   24 k
 openssl                                  x86_64          1:1.1.1k-5.el8_5                                base                  709 k
 openssl-libs                             x86_64          1:1.1.1k-5.el8_5                                base                  1.5 M
 pcre2                                    x86_64          10.32-2.el8                                     base                  246 k
 python3-libselinux                       x86_64          2.9-5.el8                                       base                  283 k
 zlib                                     x86_64          1.2.11-17.el8                                   base                  102 k
Enabling module streams:
 perl                                                     5.26                                                                       
 perl-IO-Socket-SSL                                       2.066                                                                      
 perl-libwww-perl                                         6.34                                                                       

Transaction Summary
======================================================================================================================================
Install    72 Packages
Downgrade  13 Packages

Total size: 889 M
Total download size: 25 M
Is this ok [y/N]: y
Downloading Packages:
(1/73): e2fsprogs-libs-1.45.6-2.el8.x86_64.rpm                                                        998 kB/s | 233 kB     00:00    
(2/73): libcom_err-1.45.6-2.el8.x86_64.rpm                                                            976 kB/s |  49 kB     00:00    
(3/73): libselinux-2.9-5.el8.x86_64.rpm                                                               666 kB/s | 165 kB     00:00    
(4/73): libselinux-utils-2.9-5.el8.x86_64.rpm                                                         957 kB/s | 243 kB     00:00    
(5/73): krb5-libs-1.18.2-14.el8.x86_64.rpm                                                            1.0 MB/s | 840 kB     00:00    
(6/73): libss-1.45.6-2.el8.x86_64.rpm                                                                 947 kB/s |  54 kB     00:00    
(7/73): libverto-0.3.0-5.el8.x86_64.rpm                                                               279 kB/s |  24 kB     00:00    
(8/73): e2fsprogs-1.45.6-2.el8.x86_64.rpm                                                             1.0 MB/s | 1.0 MB     00:00    
(9/73): pcre2-10.32-2.el8.x86_64.rpm                                                                  1.1 MB/s | 246 kB     00:00    
(10/73): openssl-1.1.1k-5.el8_5.x86_64.rpm                                                            1.0 MB/s | 709 kB     00:00    
(11/73): python3-libselinux-2.9-5.el8.x86_64.rpm                                                      854 kB/s | 283 kB     00:00    
(12/73): zlib-1.2.11-17.el8.x86_64.rpm                                                                807 kB/s | 102 kB     00:00    
(13/73): keyutils-libs-devel-1.5.10-9.el8.x86_64.rpm                                                  356 kB/s |  48 kB     00:00    
(14/73): libcom_err-devel-1.45.6-2.el8.x86_64.rpm                                                     421 kB/s |  38 kB     00:00    
(15/73): libkadm5-1.18.2-14.el8.x86_64.rpm                                                            884 kB/s | 187 kB     00:00    
(16/73): openssl-libs-1.1.1k-5.el8_5.x86_64.rpm                                                       1.2 MB/s | 1.5 MB     00:01    
(17/73): krb5-devel-1.18.2-14.el8.x86_64.rpm                                                          1.1 MB/s | 560 kB     00:00    
(18/73): libselinux-devel-2.9-5.el8.x86_64.rpm                                                        740 kB/s | 200 kB     00:00    
(19/73): libsepol-devel-2.9-3.el8.x86_64.rpm                                                          694 kB/s |  87 kB     00:00    
(20/73): libverto-devel-0.3.0-5.el8.x86_64.rpm                                                        122 kB/s |  18 kB     00:00    
(21/73): ncurses-compat-libs-6.1-9.20180224.el8.x86_64.rpm                                            862 kB/s | 328 kB     00:00    
(22/73): make-4.2.1-10.el8.x86_64.rpm                                                                 1.1 MB/s | 498 kB     00:00    
(23/73): pcre2-utf16-10.32-2.el8.x86_64.rpm                                                           910 kB/s | 229 kB     00:00    
(24/73): pcre2-utf32-10.32-2.el8.x86_64.rpm                                                           911 kB/s | 220 kB     00:00    
(25/73): pcre2-devel-10.32-2.el8.x86_64.rpm                                                           1.1 MB/s | 605 kB     00:00    
(26/73): perl-Data-Dumper-2.167-399.el8.x86_64.rpm                                                    1.1 MB/s |  58 kB     00:00    
(27/73): perl-Carp-1.42-396.el8.noarch.rpm                                                            439 kB/s |  30 kB     00:00    
(28/73): perl-Errno-1.28-420.el8.x86_64.rpm                                                           735 kB/s |  76 kB     00:00    
(29/73): perl-Exporter-5.72-396.el8.noarch.rpm                                                        1.0 MB/s |  34 kB     00:00    
(30/73): perl-File-Path-2.15-2.el8.noarch.rpm                                                         522 kB/s |  38 kB     00:00    
(31/73): perl-File-Temp-0.230.600-1.el8.noarch.rpm                                                    687 kB/s |  63 kB     00:00    
(32/73): perl-Getopt-Long-2.50-4.el8.noarch.rpm                                                       1.1 MB/s |  63 kB     00:00    
(33/73): perl-HTTP-Tiny-0.074-1.el8.noarch.rpm                                                        1.1 MB/s |  58 kB     00:00    
(34/73): perl-IO-1.38-420.el8.x86_64.rpm                                                              1.1 MB/s | 142 kB     00:00    
(35/73): perl-MIME-Base64-3.15-396.el8.x86_64.rpm                                                     1.1 MB/s |  31 kB     00:00    
(36/73): perl-PathTools-3.74-1.el8.x86_64.rpm                                                         1.1 MB/s |  90 kB     00:00    
(37/73): perl-Pod-Escapes-1.07-395.el8.noarch.rpm                                                     937 kB/s |  20 kB     00:00    
(38/73): perl-Pod-Perldoc-3.28-396.el8.noarch.rpm                                                     629 kB/s |  86 kB     00:00    
(39/73): perl-Pod-Simple-3.35-395.el8.noarch.rpm                                                      966 kB/s | 213 kB     00:00    
(40/73): perl-Pod-Usage-1.69-395.el8.noarch.rpm                                                       1.1 MB/s |  34 kB     00:00    
(41/73): openssl-devel-1.1.1k-5.el8_5.x86_64.rpm                                                      1.1 MB/s | 2.3 MB     00:02    
(42/73): perl-Scalar-List-Utils-1.49-2.el8.x86_64.rpm                                                 701 kB/s |  68 kB     00:00    
(43/73): perl-Socket-2.027-3.el8.x86_64.rpm                                                           657 kB/s |  59 kB     00:00    
(44/73): perl-Storable-3.11-3.el8.x86_64.rpm                                                          1.2 MB/s |  98 kB     00:00    
(45/73): perl-Term-Cap-1.17-395.el8.noarch.rpm                                                        1.0 MB/s |  23 kB     00:00    
(46/73): perl-Term-ANSIColor-4.06-396.el8.noarch.rpm                                                  580 kB/s |  46 kB     00:00    
(47/73): perl-Encode-2.97-3.el8.x86_64.rpm                                                            1.1 MB/s | 1.5 MB     00:01    
(48/73): perl-Text-ParseWords-3.30-395.el8.noarch.rpm                                                 872 kB/s |  18 kB     00:00    
(49/73): perl-Time-Local-1.280-1.el8.noarch.rpm                                                       950 kB/s |  34 kB     00:00    
(50/73): perl-Text-Tabs+Wrap-2013.0523-395.el8.noarch.rpm                                             387 kB/s |  24 kB     00:00    
(51/73): perl-constant-1.33-396.el8.noarch.rpm                                                        766 kB/s |  25 kB     00:00    
(52/73): perl-Unicode-Normalize-1.25-396.el8.x86_64.rpm                                               1.1 MB/s |  82 kB     00:00    
(53/73): perl-macros-5.26.3-420.el8.x86_64.rpm                                                        683 kB/s |  72 kB     00:00    
(54/73): perl-parent-0.237-1.el8.noarch.rpm                                                           760 kB/s |  20 kB     00:00    
(55/73): perl-podlators-4.11-1.el8.noarch.rpm                                                         1.2 MB/s | 118 kB     00:00    
(56/73): perl-threads-2.21-2.el8.x86_64.rpm                                                           1.0 MB/s |  61 kB     00:00    
(57/73): perl-threads-shared-1.58-2.el8.x86_64.rpm                                                    1.1 MB/s |  48 kB     00:00    
(58/73): zlib-devel-1.2.11-17.el8.x86_64.rpm                                                          529 kB/s |  58 kB     00:00    
(59/73): perl-libs-5.26.3-420.el8.x86_64.rpm                                                          1.1 MB/s | 1.6 MB     00:01    
(60/73): perl-Digest-1.17-395.el8.noarch.rpm                                                          414 kB/s |  27 kB     00:00    
(61/73): perl-Digest-MD5-2.55-396.el8.x86_64.rpm                                                      1.1 MB/s |  37 kB     00:00    
(62/73): perl-IO-Socket-IP-0.39-5.el8.noarch.rpm                                                      971 kB/s |  47 kB     00:00    
(63/73): compat-openssl10-1.0.2o-3.el8.x86_64.rpm                                                     993 kB/s | 1.1 MB     00:01    
(64/73): perl-IO-Socket-SSL-2.066-4.module_el8.3.0+410+ff426aa3.noarch.rpm                            1.2 MB/s | 298 kB     00:00    
(65/73): perl-JSON-2.97.001-2.el8.noarch.rpm                                                          338 kB/s |  96 kB     00:00    
(66/73): perl-Mozilla-CA-20160104-7.module_el8.3.0+416+dee7bcef.noarch.rpm                            1.1 MB/s |  15 kB     00:00    
(67/73): perl-Memoize-1.03-420.el8.noarch.rpm                                                         447 kB/s | 118 kB     00:00    
(68/73): perl-Net-SSLeay-1.88-1.module_el8.3.0+410+ff426aa3.x86_64.rpm                                1.1 MB/s | 379 kB     00:00    
(69/73): perl-Time-HiRes-1.9758-2.el8.x86_64.rpm                                                      883 kB/s |  61 kB     00:00    
(70/73): perl-URI-1.73-3.el8.noarch.rpm                                                               838 kB/s | 116 kB     00:00    
(71/73): perl-libnet-3.11-3.el8.noarch.rpm                                                            826 kB/s | 121 kB     00:00    
(72/73): perl-Test-Simple-1.302135-1.el8.noarch.rpm                                                   884 kB/s | 516 kB     00:00    
(73/73): perl-interpreter-5.26.3-420.el8.x86_64.rpm                                                   1.2 MB/s | 6.3 MB     00:05    
--------------------------------------------------------------------------------------------------------------------------------------
Total                                                                                                 2.5 MB/s |  25 MB     00:10     
Running transaction check
Transaction check succeeded.
Running transaction test
Transaction test succeeded.
Running transaction
  Preparing        :                                                                                                              1/1 
  Downgrading      : libcom_err-1.45.6-2.el8.x86_64                                                                              1/98 
  Running scriptlet: libcom_err-1.45.6-2.el8.x86_64                                                                              1/98 
  Downgrading      : zlib-1.2.11-17.el8.x86_64                                                                                   2/98 
  Downgrading      : openssl-libs-1:1.1.1k-5.el8_5.x86_64                                                                        3/98 
  Running scriptlet: openssl-libs-1:1.1.1k-5.el8_5.x86_64                                                                        3/98 
  Installing       : mysql-community-common-8.0.31-1.el7.x86_64                                                                  4/98 
  Downgrading      : pcre2-10.32-2.el8.x86_64                                                                                    5/98 
  Downgrading      : libselinux-2.9-5.el8.x86_64                                                                                 6/98 
  Running scriptlet: libselinux-2.9-5.el8.x86_64                                                                                 6/98 
  Downgrading      : libverto-0.3.0-5.el8.x86_64                                                                                 7/98 
  Downgrading      : krb5-libs-1.18.2-14.el8.x86_64                                                                              8/98 
  Installing       : libkadm5-1.18.2-14.el8.x86_64                                                                               9/98 
  Installing       : libverto-devel-0.3.0-5.el8.x86_64                                                                          10/98 
  Downgrading      : openssl-1:1.1.1k-5.el8_5.x86_64                                                                            11/98 
  Installing       : perl-Digest-1.17-395.el8.noarch                                                                            12/98 
  Installing       : perl-Digest-MD5-2.55-396.el8.x86_64                                                                        13/98 
  Installing       : perl-Data-Dumper-2.167-399.el8.x86_64                                                                      14/98 
  Installing       : perl-libnet-3.11-3.el8.noarch                                                                              15/98 
  Installing       : perl-Net-SSLeay-1.88-1.module_el8.3.0+410+ff426aa3.x86_64                                                  16/98 
  Installing       : perl-URI-1.73-3.el8.noarch                                                                                 17/98 
  Installing       : perl-Pod-Escapes-1:1.07-395.el8.noarch                                                                     18/98 
  Installing       : perl-Time-Local-1:1.280-1.el8.noarch                                                                       19/98 
  Installing       : perl-IO-Socket-IP-0.39-5.el8.noarch                                                                        20/98 
  Installing       : perl-Mozilla-CA-20160104-7.module_el8.3.0+416+dee7bcef.noarch                                              21/98 
  Installing       : perl-IO-Socket-SSL-2.066-4.module_el8.3.0+410+ff426aa3.noarch                                              22/98 
  Installing       : perl-Term-ANSIColor-4.06-396.el8.noarch                                                                    23/98 
  Installing       : perl-Term-Cap-1.17-395.el8.noarch                                                                          24/98 
  Installing       : perl-File-Temp-0.230.600-1.el8.noarch                                                                      25/98 
  Installing       : perl-Pod-Simple-1:3.35-395.el8.noarch                                                                      26/98 
  Installing       : perl-HTTP-Tiny-0.074-1.el8.noarch                                                                          27/98 
  Installing       : perl-podlators-4.11-1.el8.noarch                                                                           28/98 
  Installing       : perl-Pod-Perldoc-3.28-396.el8.noarch                                                                       29/98 
  Installing       : perl-Text-ParseWords-3.30-395.el8.noarch                                                                   30/98 
  Installing       : perl-Pod-Usage-4:1.69-395.el8.noarch                                                                       31/98 
  Installing       : perl-MIME-Base64-3.15-396.el8.x86_64                                                                       32/98 
  Installing       : perl-Storable-1:3.11-3.el8.x86_64                                                                          33/98 
  Installing       : perl-Getopt-Long-1:2.50-4.el8.noarch                                                                       34/98 
  Installing       : perl-Errno-1.28-420.el8.x86_64                                                                             35/98 
  Installing       : perl-Socket-4:2.027-3.el8.x86_64                                                                           36/98 
  Installing       : perl-Encode-4:2.97-3.el8.x86_64                                                                            37/98 
  Installing       : perl-Carp-1.42-396.el8.noarch                                                                              38/98 
  Installing       : perl-Exporter-5.72-396.el8.noarch                                                                          39/98 
  Installing       : perl-libs-4:5.26.3-420.el8.x86_64                                                                          40/98 
  Installing       : perl-Scalar-List-Utils-3:1.49-2.el8.x86_64                                                                 41/98 
  Installing       : perl-parent-1:0.237-1.el8.noarch                                                                           42/98 
  Installing       : perl-macros-4:5.26.3-420.el8.x86_64                                                                        43/98 
  Installing       : perl-Text-Tabs+Wrap-2013.0523-395.el8.noarch                                                               44/98 
  Installing       : perl-Unicode-Normalize-1.25-396.el8.x86_64                                                                 45/98 
  Installing       : perl-File-Path-2.15-2.el8.noarch                                                                           46/98 
  Installing       : perl-IO-1.38-420.el8.x86_64                                                                                47/98 
  Installing       : perl-PathTools-3.74-1.el8.x86_64                                                                           48/98 
  Installing       : perl-constant-1.33-396.el8.noarch                                                                          49/98 
  Installing       : perl-threads-1:2.21-2.el8.x86_64                                                                           50/98 
  Installing       : perl-threads-shared-1.58-2.el8.x86_64                                                                      51/98 
  Installing       : perl-interpreter-4:5.26.3-420.el8.x86_64                                                                   52/98 
  Installing       : perl-JSON-2.97.001-2.el8.noarch                                                                            53/98 
  Installing       : perl-Memoize-1.03-420.el8.noarch                                                                           54/98 
  Installing       : perl-Test-Simple-1:1.302135-1.el8.noarch                                                                   55/98 
  Installing       : perl-Time-HiRes-4:1.9758-2.el8.x86_64                                                                      56/98 
  Installing       : zlib-devel-1.2.11-17.el8.x86_64                                                                            57/98 
  Downgrading      : e2fsprogs-libs-1.45.6-2.el8.x86_64                                                                         58/98 
  Running scriptlet: e2fsprogs-libs-1.45.6-2.el8.x86_64                                                                         58/98 
  Downgrading      : libss-1.45.6-2.el8.x86_64                                                                                  59/98 
  Running scriptlet: libss-1.45.6-2.el8.x86_64                                                                                  59/98 
  Installing       : libcom_err-devel-1.45.6-2.el8.x86_64                                                                       60/98 
  Installing       : mysql-community-icu-data-files-8.0.31-1.el7.x86_64                                                         61/98 
  Installing       : pcre2-utf32-10.32-2.el8.x86_64                                                                             62/98 
  Installing       : pcre2-utf16-10.32-2.el8.x86_64                                                                             63/98 
  Installing       : pcre2-devel-10.32-2.el8.x86_64                                                                             64/98 
  Installing       : ncurses-compat-libs-6.1-9.20180224.el8.x86_64                                                              65/98 
  Installing       : make-1:4.2.1-10.el8.x86_64                                                                                 66/98 
  Running scriptlet: make-1:4.2.1-10.el8.x86_64                                                                                 66/98 
  Installing       : compat-openssl10-1:1.0.2o-3.el8.x86_64                                                                     67/98 
  Running scriptlet: compat-openssl10-1:1.0.2o-3.el8.x86_64                                                                     67/98 
  Installing       : mysql-community-client-plugins-8.0.31-1.el7.x86_64                                                         68/98 
  Installing       : mysql-community-libs-8.0.31-1.el7.x86_64                                                                   69/98 
  Running scriptlet: mysql-community-libs-8.0.31-1.el7.x86_64                                                                   69/98 
  Installing       : mysql-community-client-8.0.31-1.el7.x86_64                                                                 70/98 
  Running scriptlet: mysql-community-server-8.0.31-1.el7.x86_64                                                                 71/98 
  Installing       : mysql-community-server-8.0.31-1.el7.x86_64                                                                 71/98 
  Running scriptlet: mysql-community-server-8.0.31-1.el7.x86_64                                                                 71/98 
  Installing       : libsepol-devel-2.9-3.el8.x86_64                                                                            72/98 
  Installing       : libselinux-devel-2.9-5.el8.x86_64                                                                          73/98 
  Installing       : keyutils-libs-devel-1.5.10-9.el8.x86_64                                                                    74/98 
  Installing       : krb5-devel-1.18.2-14.el8.x86_64                                                                            75/98 
  Installing       : openssl-devel-1:1.1.1k-5.el8_5.x86_64                                                                      76/98 
  Installing       : mysql-community-devel-8.0.31-1.el7.x86_64                                                                  77/98 
  Installing       : mysql-community-server-debug-8.0.31-1.el7.x86_64                                                           78/98 
  Installing       : mysql-community-test-8.0.31-1.el7.x86_64                                                                   79/98 
  Installing       : mysql-community-libs-compat-8.0.31-1.el7.x86_64                                                            80/98 
  Running scriptlet: mysql-community-libs-compat-8.0.31-1.el7.x86_64                                                            80/98 
  Installing       : mysql-community-embedded-compat-8.0.31-1.el7.x86_64                                                        81/98 
  Downgrading      : e2fsprogs-1.45.6-2.el8.x86_64                                                                              82/98 
  Downgrading      : libselinux-utils-2.9-5.el8.x86_64                                                                          83/98 
  Downgrading      : python3-libselinux-2.9-5.el8.x86_64                                                                        84/98 
  Installing       : mysql-community-debuginfo-8.0.31-1.el7.x86_64                                                              85/98 
  Cleanup          : krb5-libs-1.18.2-21.el8.x86_64                                                                             86/98 
  Cleanup          : openssl-1:1.1.1k-6.el8.x86_64                                                                              87/98 
  Cleanup          : e2fsprogs-1.45.6-5.el8.x86_64                                                                              88/98 
  Cleanup          : libselinux-utils-2.9-6.el8.x86_64                                                                          89/98 
  Cleanup          : e2fsprogs-libs-1.45.6-5.el8.x86_64                                                                         90/98 
  Running scriptlet: e2fsprogs-libs-1.45.6-5.el8.x86_64                                                                         90/98 
  Cleanup          : libss-1.45.6-5.el8.x86_64                                                                                  91/98 
  Running scriptlet: libss-1.45.6-5.el8.x86_64                                                                                  91/98 
  Cleanup          : python3-libselinux-2.9-6.el8.x86_64                                                                        92/98 
  Cleanup          : libselinux-2.9-6.el8.x86_64                                                                                93/98 
  Cleanup          : openssl-libs-1:1.1.1k-6.el8.x86_64                                                                         94/98 
  Running scriptlet: openssl-libs-1:1.1.1k-6.el8.x86_64                                                                         94/98 
  Cleanup          : zlib-1.2.11-19.el8.x86_64                                                                                  95/98 
  Cleanup          : pcre2-10.32-3.el8.x86_64                                                                                   96/98 
  Cleanup          : libcom_err-1.45.6-5.el8.x86_64                                                                             97/98 
  Running scriptlet: libcom_err-1.45.6-5.el8.x86_64                                                                             97/98 
  Cleanup          : libverto-0.3.2-2.el8.x86_64                                                                                98/98 
  Running scriptlet: libverto-0.3.2-2.el8.x86_64                                                                                98/98 
  Verifying        : e2fsprogs-1.45.6-2.el8.x86_64                                                                               1/98 
  Verifying        : e2fsprogs-1.45.6-5.el8.x86_64                                                                               2/98 
  Verifying        : e2fsprogs-libs-1.45.6-2.el8.x86_64                                                                          3/98 
  Verifying        : e2fsprogs-libs-1.45.6-5.el8.x86_64                                                                          4/98 
  Verifying        : krb5-libs-1.18.2-14.el8.x86_64                                                                              5/98 
  Verifying        : krb5-libs-1.18.2-21.el8.x86_64                                                                              6/98 
  Verifying        : libcom_err-1.45.6-2.el8.x86_64                                                                              7/98 
  Verifying        : libcom_err-1.45.6-5.el8.x86_64                                                                              8/98 
  Verifying        : libselinux-2.9-5.el8.x86_64                                                                                 9/98 
  Verifying        : libselinux-2.9-6.el8.x86_64                                                                                10/98 
  Verifying        : libselinux-utils-2.9-5.el8.x86_64                                                                          11/98 
  Verifying        : libselinux-utils-2.9-6.el8.x86_64                                                                          12/98 
  Verifying        : libss-1.45.6-2.el8.x86_64                                                                                  13/98 
  Verifying        : libss-1.45.6-5.el8.x86_64                                                                                  14/98 
  Verifying        : libverto-0.3.0-5.el8.x86_64                                                                                15/98 
  Verifying        : libverto-0.3.2-2.el8.x86_64                                                                                16/98 
  Verifying        : openssl-1:1.1.1k-5.el8_5.x86_64                                                                            17/98 
  Verifying        : openssl-1:1.1.1k-6.el8.x86_64                                                                              18/98 
  Verifying        : openssl-libs-1:1.1.1k-5.el8_5.x86_64                                                                       19/98 
  Verifying        : openssl-libs-1:1.1.1k-6.el8.x86_64                                                                         20/98 
  Verifying        : pcre2-10.32-2.el8.x86_64                                                                                   21/98 
  Verifying        : pcre2-10.32-3.el8.x86_64                                                                                   22/98 
  Verifying        : python3-libselinux-2.9-5.el8.x86_64                                                                        23/98 
  Verifying        : python3-libselinux-2.9-6.el8.x86_64                                                                        24/98 
  Verifying        : zlib-1.2.11-17.el8.x86_64                                                                                  25/98 
  Verifying        : zlib-1.2.11-19.el8.x86_64                                                                                  26/98 
  Verifying        : keyutils-libs-devel-1.5.10-9.el8.x86_64                                                                    27/98 
  Verifying        : krb5-devel-1.18.2-14.el8.x86_64                                                                            28/98 
  Verifying        : libcom_err-devel-1.45.6-2.el8.x86_64                                                                       29/98 
  Verifying        : libkadm5-1.18.2-14.el8.x86_64                                                                              30/98 
  Verifying        : libselinux-devel-2.9-5.el8.x86_64                                                                          31/98 
  Verifying        : libsepol-devel-2.9-3.el8.x86_64                                                                            32/98 
  Verifying        : libverto-devel-0.3.0-5.el8.x86_64                                                                          33/98 
  Verifying        : make-1:4.2.1-10.el8.x86_64                                                                                 34/98 
  Verifying        : ncurses-compat-libs-6.1-9.20180224.el8.x86_64                                                              35/98 
  Verifying        : openssl-devel-1:1.1.1k-5.el8_5.x86_64                                                                      36/98 
  Verifying        : pcre2-devel-10.32-2.el8.x86_64                                                                             37/98 
  Verifying        : pcre2-utf16-10.32-2.el8.x86_64                                                                             38/98 
  Verifying        : pcre2-utf32-10.32-2.el8.x86_64                                                                             39/98 
  Verifying        : perl-Carp-1.42-396.el8.noarch                                                                              40/98 
  Verifying        : perl-Data-Dumper-2.167-399.el8.x86_64                                                                      41/98 
  Verifying        : perl-Encode-4:2.97-3.el8.x86_64                                                                            42/98 
  Verifying        : perl-Errno-1.28-420.el8.x86_64                                                                             43/98 
  Verifying        : perl-Exporter-5.72-396.el8.noarch                                                                          44/98 
  Verifying        : perl-File-Path-2.15-2.el8.noarch                                                                           45/98 
  Verifying        : perl-File-Temp-0.230.600-1.el8.noarch                                                                      46/98 
  Verifying        : perl-Getopt-Long-1:2.50-4.el8.noarch                                                                       47/98 
  Verifying        : perl-HTTP-Tiny-0.074-1.el8.noarch                                                                          48/98 
  Verifying        : perl-IO-1.38-420.el8.x86_64                                                                                49/98 
  Verifying        : perl-MIME-Base64-3.15-396.el8.x86_64                                                                       50/98 
  Verifying        : perl-PathTools-3.74-1.el8.x86_64                                                                           51/98 
  Verifying        : perl-Pod-Escapes-1:1.07-395.el8.noarch                                                                     52/98 
  Verifying        : perl-Pod-Perldoc-3.28-396.el8.noarch                                                                       53/98 
  Verifying        : perl-Pod-Simple-1:3.35-395.el8.noarch                                                                      54/98 
  Verifying        : perl-Pod-Usage-4:1.69-395.el8.noarch                                                                       55/98 
  Verifying        : perl-Scalar-List-Utils-3:1.49-2.el8.x86_64                                                                 56/98 
  Verifying        : perl-Socket-4:2.027-3.el8.x86_64                                                                           57/98 
  Verifying        : perl-Storable-1:3.11-3.el8.x86_64                                                                          58/98 
  Verifying        : perl-Term-ANSIColor-4.06-396.el8.noarch                                                                    59/98 
  Verifying        : perl-Term-Cap-1.17-395.el8.noarch                                                                          60/98 
  Verifying        : perl-Text-ParseWords-3.30-395.el8.noarch                                                                   61/98 
  Verifying        : perl-Text-Tabs+Wrap-2013.0523-395.el8.noarch                                                               62/98 
  Verifying        : perl-Time-Local-1:1.280-1.el8.noarch                                                                       63/98 
  Verifying        : perl-Unicode-Normalize-1.25-396.el8.x86_64                                                                 64/98 
  Verifying        : perl-constant-1.33-396.el8.noarch                                                                          65/98 
  Verifying        : perl-interpreter-4:5.26.3-420.el8.x86_64                                                                   66/98 
  Verifying        : perl-libs-4:5.26.3-420.el8.x86_64                                                                          67/98 
  Verifying        : perl-macros-4:5.26.3-420.el8.x86_64                                                                        68/98 
  Verifying        : perl-parent-1:0.237-1.el8.noarch                                                                           69/98 
  Verifying        : perl-podlators-4.11-1.el8.noarch                                                                           70/98 
  Verifying        : perl-threads-1:2.21-2.el8.x86_64                                                                           71/98 
  Verifying        : perl-threads-shared-1.58-2.el8.x86_64                                                                      72/98 
  Verifying        : zlib-devel-1.2.11-17.el8.x86_64                                                                            73/98 
  Verifying        : compat-openssl10-1:1.0.2o-3.el8.x86_64                                                                     74/98 
  Verifying        : perl-Digest-1.17-395.el8.noarch                                                                            75/98 
  Verifying        : perl-Digest-MD5-2.55-396.el8.x86_64                                                                        76/98 
  Verifying        : perl-IO-Socket-IP-0.39-5.el8.noarch                                                                        77/98 
  Verifying        : perl-IO-Socket-SSL-2.066-4.module_el8.3.0+410+ff426aa3.noarch                                              78/98 
  Verifying        : perl-JSON-2.97.001-2.el8.noarch                                                                            79/98 
  Verifying        : perl-Memoize-1.03-420.el8.noarch                                                                           80/98 
  Verifying        : perl-Mozilla-CA-20160104-7.module_el8.3.0+416+dee7bcef.noarch                                              81/98 
  Verifying        : perl-Net-SSLeay-1.88-1.module_el8.3.0+410+ff426aa3.x86_64                                                  82/98 
  Verifying        : perl-Test-Simple-1:1.302135-1.el8.noarch                                                                   83/98 
  Verifying        : perl-Time-HiRes-4:1.9758-2.el8.x86_64                                                                      84/98 
  Verifying        : perl-URI-1.73-3.el8.noarch                                                                                 85/98 
  Verifying        : perl-libnet-3.11-3.el8.noarch                                                                              86/98 
  Verifying        : mysql-community-client-8.0.31-1.el7.x86_64                                                                 87/98 
  Verifying        : mysql-community-client-plugins-8.0.31-1.el7.x86_64                                                         88/98 
  Verifying        : mysql-community-common-8.0.31-1.el7.x86_64                                                                 89/98 
  Verifying        : mysql-community-debuginfo-8.0.31-1.el7.x86_64                                                              90/98 
  Verifying        : mysql-community-devel-8.0.31-1.el7.x86_64                                                                  91/98 
  Verifying        : mysql-community-embedded-compat-8.0.31-1.el7.x86_64                                                        92/98 
  Verifying        : mysql-community-icu-data-files-8.0.31-1.el7.x86_64                                                         93/98 
  Verifying        : mysql-community-libs-8.0.31-1.el7.x86_64                                                                   94/98 
  Verifying        : mysql-community-libs-compat-8.0.31-1.el7.x86_64                                                            95/98 
  Verifying        : mysql-community-server-8.0.31-1.el7.x86_64                                                                 96/98 
  Verifying        : mysql-community-server-debug-8.0.31-1.el7.x86_64                                                           97/98 
  Verifying        : mysql-community-test-8.0.31-1.el7.x86_64                                                                   98/98 

Downgraded:
  e2fsprogs-1.45.6-2.el8.x86_64                e2fsprogs-libs-1.45.6-2.el8.x86_64         krb5-libs-1.18.2-14.el8.x86_64             
  libcom_err-1.45.6-2.el8.x86_64               libselinux-2.9-5.el8.x86_64                libselinux-utils-2.9-5.el8.x86_64          
  libss-1.45.6-2.el8.x86_64                    libverto-0.3.0-5.el8.x86_64                openssl-1:1.1.1k-5.el8_5.x86_64            
  openssl-libs-1:1.1.1k-5.el8_5.x86_64         pcre2-10.32-2.el8.x86_64                   python3-libselinux-2.9-5.el8.x86_64        
  zlib-1.2.11-17.el8.x86_64                   
Installed:
  compat-openssl10-1:1.0.2o-3.el8.x86_64                          keyutils-libs-devel-1.5.10-9.el8.x86_64                            
  krb5-devel-1.18.2-14.el8.x86_64                                 libcom_err-devel-1.45.6-2.el8.x86_64                               
  libkadm5-1.18.2-14.el8.x86_64                                   libselinux-devel-2.9-5.el8.x86_64                                  
  libsepol-devel-2.9-3.el8.x86_64                                 libverto-devel-0.3.0-5.el8.x86_64                                  
  make-1:4.2.1-10.el8.x86_64                                      mysql-community-client-8.0.31-1.el7.x86_64                         
  mysql-community-client-plugins-8.0.31-1.el7.x86_64              mysql-community-common-8.0.31-1.el7.x86_64                         
  mysql-community-debuginfo-8.0.31-1.el7.x86_64                   mysql-community-devel-8.0.31-1.el7.x86_64                          
  mysql-community-embedded-compat-8.0.31-1.el7.x86_64             mysql-community-icu-data-files-8.0.31-1.el7.x86_64                 
  mysql-community-libs-8.0.31-1.el7.x86_64                        mysql-community-libs-compat-8.0.31-1.el7.x86_64                    
  mysql-community-server-8.0.31-1.el7.x86_64                      mysql-community-server-debug-8.0.31-1.el7.x86_64                   
  mysql-community-test-8.0.31-1.el7.x86_64                        ncurses-compat-libs-6.1-9.20180224.el8.x86_64                      
  openssl-devel-1:1.1.1k-5.el8_5.x86_64                           pcre2-devel-10.32-2.el8.x86_64                                     
  pcre2-utf16-10.32-2.el8.x86_64                                  pcre2-utf32-10.32-2.el8.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-420.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-420.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-JSON-2.97.001-2.el8.noarch                                 perl-MIME-Base64-3.15-396.el8.x86_64                               
  perl-Memoize-1.03-420.el8.noarch                                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-Test-Simple-1:1.302135-1.el8.noarch                           
  perl-Text-ParseWords-3.30-395.el8.noarch                        perl-Text-Tabs+Wrap-2013.0523-395.el8.noarch                       
  perl-Time-HiRes-4:1.9758-2.el8.x86_64                           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-420.el8.x86_64                           
  perl-libnet-3.11-3.el8.noarch                                   perl-libs-4:5.26.3-420.el8.x86_64                                  
  perl-macros-4:5.26.3-420.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                           zlib-devel-1.2.11-17.el8.x86_64                                    

Complete!

[root@220-230 src]# vim /etc/my.cnf      #忘记root密码
[mysqld]
skip_grant_tables
[root@220-230 src]# systemctl restart mysqld
[root@220-230 src]# mysql -u root -p
Enter password: 
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 7
Server version: 8.0.31 MySQL Community Server - GPL

Copyright (c) 2000, 2022, Oracle and/or its affiliates.

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> use mysql
Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -A

Database changed
mysql> update user set authentication_string='' where user='root';
Query OK, 1 row affected (0.01 sec)
Rows matched: 1  Changed: 1  Warnings: 0

mysql> exit
Bye
[root@220-230 src]# vim /etc/my.cnf       #删除添加的skip_grant_tables
[root@220-230 src]# systemctl restart mysqld
[root@220-230 src]# 
[root@220-230 src]# mysql -uroot -p
Enter password: 
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 7
Server version: 8.0.31 MySQL Community Server - GPL

Copyright (c) 2000, 2022, Oracle and/or its affiliates.

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> alter user 'root'@'localhost' identified with mysql_native_password by 'dXnlTxbFRQ==';
Query OK, 0 rows affected (0.00 sec)

mysql> flush privileges;
Query OK, 0 rows affected (0.00 sec)
mysql> exit
Bye
[root@220-230 src]# mysql -uroot -p     #登录使用新密码测试
Enter password: 
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 9
Server version: 8.0.31 MySQL Community Server - GPL

Copyright (c) 2000, 2022, Oracle and/or its affiliates.

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>
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

DevonL77

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值