在安装部署MySQL8之后, 如果遇到重大bug或者需要新的特性,就需要升级小版本了,MySQL升级小版本比以前简单多了,在此演示一下。
本次演示由8.0.18升级到8.0.32
一 安装 MySQL 8.0.18
#关闭selinux
sed -i "s/SELINUX=enforcing/SELINUX=disabled/g" /etc/selinux/config ;
setenforce 0
#解压安装包
[root@localhost ~]# tar -xvf mysql-8.0.18-1.el7.x86_64.rpm-bundle.tar
mysql-community-libs-8.0.18-1.el7.x86_64.rpm
mysql-community-devel-8.0.18-1.el7.x86_64.rpm
mysql-community-embedded-compat-8.0.18-1.el7.x86_64.rpm
mysql-community-libs-compat-8.0.18-1.el7.x86_64.rpm
mysql-community-common-8.0.18-1.el7.x86_64.rpm
mysql-community-server-8.0.18-1.el7.x86_64.rpm
mysql-community-client-8.0.18-1.el7.x86_64.rpm
#移除mariadb-libs
[root@localhost ~]# yum -y remove mariadb-libs
Loaded plugins: fastestmirror
Resolving Dependencies
--> Running transaction check
---> Package mariadb-libs.x86_64 1:5.5.65-1.el7 will be erased
--> Processing Dependency: libmysqlclient.so.18()(64bit) for package: 2:postfix-2.10.1-9.el7.x86_64
--> Processing Dependency: libmysqlclient.so.18(libmysqlclient_18)(64bit) for package: 2:postfix-2.10.1-9.el7.x86_64
--> Running transaction check
---> Package postfix.x86_64 2:2.10.1-9.el7 will be erased
--> Finished Dependency Resolution
Dependencies Resolved
===================================================================================================================================================
Package Arch Version Repository Size
===================================================================================================================================================
Removing:
mariadb-libs x86_64 1:5.5.65-1.el7 @anaconda 4.4 M
Removing for dependencies:
postfix x86_64 2:2.10.1-9.el7 @anaconda 12 M
Transaction Summary
===================================================================================================================================================
Remove 1 Package (+1 Dependent package)
Installed size: 17 M
Downloading packages:
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
Erasing : 2:postfix-2.10.1-9.el7.x86_64 1/2
Erasing : 1:mariadb-libs-5.5.65-1.el7.x86_64 2/2
Verifying : 1:mariadb-libs-5.5.65-1.el7.x86_64 1/2
Verifying : 2:postfix-2.10.1-9.el7.x86_64 2/2
Removed:
mariadb-libs.x86_64 1:5.5.65-1.el7
Dependency Removed:
postfix.x86_64 2:2.10.1-9.el7
Complete!
#安装
[root@localhost ~]# yum -y localinstall mysql-community-{server,client,common,libs,devel,libs-compat}-8.0.18-1.el7.x86_64.rpm
Loaded plugins: fastestmirror
Examining mysql-community-server-8.0.18-1.el7.x86_64.rpm: mysql-community-server-8.0.18-1.el7.x86_64
Marking mysql-community-server-8.0.18-1.el7.x86_64.rpm to be installed
Examining mysql-community-client-8.0.18-1.el7.x86_64.rpm: mysql-community-client-8.0.18-1.el7.x86_64
Marking mysql-community-client-8.0.18-1.el7.x86_64.rpm to be installed
Examining mysql-community-common-8.0.18-1.el7.x86_64.rpm: mysql-community-common-8.0.18-1.el7.x86_64
Marking mysql-community-common-8.0.18-1.el7.x86_64.rpm to be installed
Examining mysql-community-libs-8.0.18-1.el7.x86_64.rpm: mysql-community-libs-8.0.18-1.el7.x86_64
Marking mysql-community-libs-8.0.18-1.el7.x86_64.rpm to be installed
Examining mysql-community-devel-8.0.18-1.el7.x86_64.rpm: mysql-community-devel-8.0.18-1.el7.x86_64
Marking mysql-community-devel-8.0.18-1.el7.x86_64.rpm to be installed
Examining mysql-community-libs-compat-8.0.18-1.el7.x86_64.rpm: mysql-community-libs-compat-8.0.18-1.el7.x86_64
Marking mysql-community-libs-compat-8.0.18-1.el7.x86_64.rpm to be installed
Resolving Dependencies
--> Running transaction check
---> Package mysql-community-client.x86_64 0:8.0.18-1.el7 will be installed
---> Package mysql-community-common.x86_64 0:8.0.18-1.el7 will be installed
---> Package mysql-community-devel.x86_64 0:8.0.18-1.el7 will be installed
--> Processing Dependency: pkgconfig(openssl) for package: mysql-community-devel-8.0.18-1.el7.x86_64
Determining fastest mirrors
centos_base | 3.6 kB 00:00:00
---> Package mysql-community-libs.x86_64 0:8.0.18-1.el7 will be installed
---> Package mysql-community-libs-compat.x86_64 0:8.0.18-1.el7 will be installed
---> Package mysql-community-server.x86_64 0:8.0.18-1.el7 will be installed
--> Processing Dependency: /usr/bin/perl for package: mysql-community-server-8.0.18-1.el7.x86_64
--> Processing Dependency: net-tools for package: mysql-community-server-8.0.18-1.el7.x86_64
--> Processing Dependency: perl(Getopt::Long) for package: mysql-community-server-8.0.18-1.el7.x86_64
--> Processing Dependency: perl(strict) for package: mysql-community-server-8.0.18-1.el7.x86_64
--> Running transaction check
---> Package net-tools.x86_64 0:2.0-0.25.20131004git.el7 will be installed
---> Package openssl-devel.x86_64 1:1.0.2k-19.el7 will be installed
--> Processing Dependency: zlib-devel(x86-64) for package: 1:openssl-devel-1.0.2k-19.el7.x86_64
--> Processing Dependency: krb5-devel(x86-64) for package: 1:openssl-devel-1.0.2k-19.el7.x86_64
---> Package perl.x86_64 4:5.16.3-297.el7 will be installed
--> Processing Dependency: perl-libs = 4:5.16.3-297.el7 for package: 4:perl-5.16.3-297.el7.x86_64
--> Processing Dependency: perl(Socket) >= 1.3 for package: 4:perl-5.16.3-297.el7.x86_64
--> Processing Dependency: perl(Scalar::Util) >= 1.10 for package: 4:perl-5.16.3-297.el7.x86_64
--> Processing Dependency: perl-macros for package: 4:perl-5.16.3-297.el7.x86_64
--> Processing Dependency: perl-libs for package: 4:perl-5.16.3-297.el7.x86_64
--> Processing Dependency: perl(threads::shared) for package: 4:perl-5.16.3-297.el7.x86_64
--> Processing Dependency: perl(threads) for package: 4:perl-5.16.3-297.el7.x86_64
--> Processing Dependency: perl(constant) for package: 4:perl-5.16.3-297.el7.x86_64
--> Processing Dependency: perl(Time::Local) for package: 4:perl-5.16.3-297.el7.x86_64
--> Processing Dependency: perl(Time::HiRes) for package: 4:perl-5.16.3-297.el7.x86_64
--> Processing Dependency: perl(Storable) for package: 4:perl-5.16.3-297.el7.x86_64
--> Processing Dependency: perl(Socket) for package: 4:perl-5.16.3-297.el7.x86_64
--> Processing Dependency: perl(Scalar::Util) for package: 4:perl-5.16.3-297.el7.x86_64
--> Processing Dependency: perl(Pod::Simple::XHTML) for package: 4:perl-5.16.3-297.el7.x86_64
--> Processing Dependency: perl(Pod::Simple::Search) for package: 4:perl-5.16.3-297.el7.x86_64
--> Processing Dependency: perl(Filter::Util::Call) for package: 4:perl-5.16.3-297.el7.x86_64
--> Processing Dependency: perl(File::Temp) for package: 4:perl-5.16.3-297.el7.x86_64
--> Processing Dependency: perl(File::Spec::Unix) for package: 4:perl-5.16.3-297.el7.x86_64
--> Processing Dependency: perl(File::Spec::Functions) for package: 4:perl-5.16.3-297.el7.x86_64
--> Processing Dependency: perl(File::Spec) for package: 4:perl-5.16.3-297.el7.x86_64
--> Processing Dependency: perl(File::Path) for package: 4:perl-5.16.3-297.el7.x86_64
--> Processing Dependency: perl(Exporter) for package: 4:perl-5.16.3-297.el7.x86_64
--> Processing Dependency: perl(Cwd) for package: 4:perl-5.16.3-297.el7.x86_64
--> Processing Dependency: perl(Carp) for package: 4:perl-5.16.3-297.el7.x86_64
--> Processing Dependency: libperl.so()(64bit) for package: 4:perl-5.16.3-297.el7.x86_64
---> Package perl-Getopt-Long.noarch 0:2.40-3.el7 will be installed
--> Processing Dependency: perl(Pod::Usage) >= 1.14 for package: perl-Getopt-Long-2.40-3.el7.noarch
--> Processing Dependency: perl(Text::ParseWords) for package: perl-Getopt-Long-2.40-3.el7.noarch
--> Running transaction check
---> Package krb5-devel.x86_64 0:1.15.1-50.el7 will be installed
--> Processing Dependency: libkadm5(x86-64) = 1.15.1-50.el7 for package: krb5-devel-1.15.1-50.el7.x86_64
--> Processing Dependency: libverto-devel for package: krb5-devel-1.15.1-50.el7.x86_64
--> Processing Dependency: libselinux-devel for package: krb5-devel-1.15.1-50.el7.x86_64
--> Processing Dependency: libcom_err-devel for package: krb5-devel-1.15.1-50.el7.x86_64
--> Processing Dependency: keyutils-libs-devel for package: krb5-devel-1.15.1-50.el7.x86_64
---> Package perl-Carp.noarch 0:1.26-244.el7 will be installed
---> Package perl-Exporter.noarch 0:5.68-3.el7 will be installed
---> Package perl-File-Path.noarch 0:2.09-2.el7 will be installed
---> Package perl-File-Temp.noarch 0:0.23.01-3.el7 will be installed
---> Package perl-Filter.x86_64 0:1.49-3.el7 will be installed
---> Package perl-PathTools.x86_64 0:3.40-5.el7 will be installed
---> Package perl-Pod-Simple.noarch 1:3.28-4.el7 will be installed
--> Processing Dependency: perl(Pod::Escapes) >= 1.04 for package: 1:perl-Pod-Simple-3.28-4.el7.noarch
--> Processing Dependency: perl(Encode) for package: 1:perl-Pod-Simple-3.28-4.el7.noarch
---> Package perl-Pod-Usage.noarch 0:1.63-3.el7 will be installed
--> Processing Dependency: perl(Pod::Text) >= 3.15 for package: perl-Pod-Usage-1.63-3.el7.noarch
--> Processing Dependency: perl-Pod-Perldoc for package: perl-Pod-Usage-1.63-3.el7.noarch
---> Package perl-Scalar-List-Utils.x86_64 0:1.27-248.el7 will be installed
---> Package perl-Socket.x86_64 0:2.010-5.el7 will be installed
---> Package perl-Storable.x86_64 0:2.45-3.el7 will be installed
---> Package perl-Text-ParseWords.noarch 0:3.29-4.el7 will be installed
---> Package perl-Time-HiRes.x86_64 4:1.9725-3.el7 will be installed
---> Package perl-Time-Local.noarch 0:1.2300-2.el7 will be installed
---> Package perl-constant.noarch 0:1.27-2.el7 will be installed
---> Package perl-libs.x86_64 4:5.16.3-297.el7 will be installed
---> Package perl-macros.x86_64 4:5.16.3-297.el7 will be installed
---> Package perl-threads.x86_64 0:1.87-4.el7 will be installed
---> Package perl-threads-shared.x86_64 0:1.43-6.el7 will be installed
---> Package zlib-devel.x86_64 0:1.2.7-18.el7 will be installed
--> Running transaction check
---> Package keyutils-libs-devel.x86_64 0:1.5.8-3.el7 will be installed
---> Package libcom_err-devel.x86_64 0:1.42.9-19.el7 will be installed
---> Package libkadm5.x86_64 0:1.15.1-50.el7 will be installed
---> Package libselinux-devel.x86_64 0:2.5-15.el7 will be installed
--> Processing Dependency: libsepol-devel(x86-64) >= 2.5-10 for package: libselinux-devel-2.5-15.el7.x86_64
--> Processing Dependency: pkgconfig(libsepol) for package: libselinux-devel-2.5-15.el7.x86_64
--> Processing Dependency: pkgconfig(libpcre) for package: libselinux-devel-2.5-15.el7.x86_64
---> Package libverto-devel.x86_64 0:0.2.5-4.el7 will be installed
---> Package perl-Encode.x86_64 0:2.51-7.el7 will be installed
---> Package perl-Pod-Escapes.noarch 1:1.04-297.el7 will be installed
---> Package perl-Pod-Perldoc.noarch 0:3.20-4.el7 will be installed
--> Processing Dependency: perl(parent) for package: perl-Pod-Perldoc-3.20-4.el7.noarch
--> Processing Dependency: perl(HTTP::Tiny) for package: perl-Pod-Perldoc-3.20-4.el7.noarch
---> Package perl-podlators.noarch 0:2.5.1-3.el7 will be installed
--> Running transaction check
---> Package libsepol-devel.x86_64 0:2.5-10.el7 will be installed
---> Package pcre-devel.x86_64 0:8.32-17.el7 will be installed
---> Package perl-HTTP-Tiny.noarch 0:0.033-3.el7 will be installed
---> Package perl-parent.noarch 1:0.225-244.el7 will be installed
--> Finished Dependency Resolution
Dependencies Resolved
===================================================================================================================================================
Package Arch Version Repository Size
===================================================================================================================================================
Installing:
mysql-community-client x86_64 8.0.18-1.el7 /mysql-community-client-8.0.18-1.el7.x86_64 177 M
mysql-community-common x86_64 8.0.18-1.el7 /mysql-community-common-8.0.18-1.el7.x86_64 8.4 M
mysql-community-devel x86_64 8.0.18-1.el7 /mysql-community-devel-8.0.18-1.el7.x86_64 44 M
mysql-community-libs x86_64 8.0.18-1.el7 /mysql-community-libs-8.0.18-1.el7.x86_64 17 M
mysql-community-libs-compat x86_64 8.0.18-1.el7 /mysql-community-libs-compat-8.0.18-1.el7.x86_64 6.3 M
mysql-community-server x86_64 8.0.18-1.el7 /mysql-community-server-8.0.18-1.el7.x86_64 1.9 G
Installing for dependencies:
keyutils-libs-devel x86_64 1.5.8-3.el7 centos_base 37 k
krb5-devel x86_64 1.15.1-50.el7 centos_base 273 k
libcom_err-devel x86_64 1.42.9-19.el7 centos_base 32 k
libkadm5 x86_64 1.15.1-50.el7 centos_base 179 k
libselinux-devel x86_64 2.5-15.el7 centos_base 187 k
libsepol-devel x86_64 2.5-10.el7 centos_base 77 k
libverto-devel x86_64 0.2.5-4.el7 centos_base 12 k
net-tools x86_64 2.0-0.25.20131004git.el7 centos_base 306 k
openssl-devel x86_64 1:1.0.2k-19.el7 centos_base 1.5 M
pcre-devel x86_64 8.32-17.el7 centos_base 480 k
perl x86_64 4:5.16.3-297.el7 centos_base 8.0 M
perl-Carp noarch 1.26-244.el7 centos_base 19 k
perl-Encode x86_64 2.51-7.el7 centos_base 1.5 M
perl-Exporter noarch 5.68-3.el7 centos_base 28 k
perl-File-Path noarch 2.09-2.el7 centos_base 26 k
perl-File-Temp noarch 0.23.01-3.el7 centos_base 56 k
perl-Filter x86_64 1.49-3.el7 centos_base 76 k
perl-Getopt-Long noarch 2.40-3.el7 centos_base 56 k
perl-HTTP-Tiny noarch 0.033-3.el7 centos_base 38 k
perl-PathTools x86_64 3.40-5.el7 centos_base 82 k
perl-Pod-Escapes noarch 1:1.04-297.el7 centos_base 52 k
perl-Pod-Perldoc noarch 3.20-4.el7 centos_base 87 k
perl-Pod-Simple noarch 1:3.28-4.el7 centos_base 216 k
perl-Pod-Usage noarch 1.63-3.el7 centos_base 27 k
perl-Scalar-List-Utils x86_64 1.27-248.el7 centos_base 36 k
perl-Socket x86_64 2.010-5.el7 centos_base 49 k
perl-Storable x86_64 2.45-3.el7 centos_base 77 k
perl-Text-ParseWords noarch 3.29-4.el7 centos_base 14 k
perl-Time-HiRes x86_64 4:1.9725-3.el7 centos_base 45 k
perl-Time-Local noarch 1.2300-2.el7 centos_base 24 k
perl-constant noarch 1.27-2.el7 centos_base 19 k
perl-libs x86_64 4:5.16.3-297.el7 centos_base 689 k
perl-macros x86_64 4:5.16.3-297.el7 centos_base 44 k
perl-parent noarch 1:0.225-244.el7 centos_base 12 k
perl-podlators noarch 2.5.1-3.el7 centos_base 112 k
perl-threads x86_64 1.87-4.el7 centos_base 49 k
perl-threads-shared x86_64 1.43-6.el7 centos_base 39 k
zlib-devel x86_64 1.2.7-18.el7 centos_base 50 k
Transaction Summary
===================================================================================================================================================
Install 6 Packages (+38 Dependent packages)
Total size: 2.2 G
Total download size: 14 M
Installed size: 2.2 G
Downloading packages:
---------------------------------------------------------------------------------------------------------------------------------------------------
Total 41 MB/s | 14 MB 00:00:00
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
Installing : mysql-community-common-8.0.18-1.el7.x86_64 1/44
Installing : mysql-community-libs-8.0.18-1.el7.x86_64 2/44
Installing : mysql-community-client-8.0.18-1.el7.x86_64 3/44
Installing : 1:perl-parent-0.225-244.el7.noarch 4/44
Installing : perl-HTTP-Tiny-0.033-3.el7.noarch 5/44
Installing : perl-podlators-2.5.1-3.el7.noarch 6/44
Installing : perl-Pod-Perldoc-3.20-4.el7.noarch 7/44
Installing : 1:perl-Pod-Escapes-1.04-297.el7.noarch 8/44
Installing : perl-Encode-2.51-7.el7.x86_64 9/44
Installing : perl-Text-ParseWords-3.29-4.el7.noarch 10/44
Installing : perl-Pod-Usage-1.63-3.el7.noarch 11/44
Installing : 4:perl-libs-5.16.3-297.el7.x86_64 12/44
Installing : perl-Storable-2.45-3.el7.x86_64 13/44
Installing : perl-Exporter-5.68-3.el7.noarch 14/44
Installing : perl-constant-1.27-2.el7.noarch 15/44
Installing : perl-Socket-2.010-5.el7.x86_64 16/44
Installing : perl-Time-Local-1.2300-2.el7.noarch 17/44
Installing : perl-Carp-1.26-244.el7.noarch 18/44
Installing : 4:perl-Time-HiRes-1.9725-3.el7.x86_64 19/44
Installing : 1:perl-Pod-Simple-3.28-4.el7.noarch 20/44
Installing : perl-PathTools-3.40-5.el7.x86_64 21/44
Installing : perl-Scalar-List-Utils-1.27-248.el7.x86_64 22/44
Installing : perl-threads-shared-1.43-6.el7.x86_64 23/44
Installing : perl-threads-1.87-4.el7.x86_64 24/44
Installing : perl-Filter-1.49-3.el7.x86_64 25/44
Installing : perl-File-Temp-0.23.01-3.el7.noarch 26/44
Installing : perl-File-Path-2.09-2.el7.noarch 27/44
Installing : 4:perl-macros-5.16.3-297.el7.x86_64 28/44
Installing : perl-Getopt-Long-2.40-3.el7.noarch 29/44
Installing : 4:perl-5.16.3-297.el7.x86_64 30/44
Installing : libcom_err-devel-1.42.9-19.el7.x86_64 31/44
Installing : pcre-devel-8.32-17.el7.x86_64 32/44
Installing : libsepol-devel-2.5-10.el7.x86_64 33/44
Installing : libselinux-devel-2.5-15.el7.x86_64 34/44
Installing : net-tools-2.0-0.25.20131004git.el7.x86_64 35/44
Installing : zlib-devel-1.2.7-18.el7.x86_64 36/44
Installing : libverto-devel-0.2.5-4.el7.x86_64 37/44
Installing : libkadm5-1.15.1-50.el7.x86_64 38/44
Installing : keyutils-libs-devel-1.5.8-3.el7.x86_64 39/44
Installing : krb5-devel-1.15.1-50.el7.x86_64 40/44
Installing : 1:openssl-devel-1.0.2k-19.el7.x86_64 41/44
Installing : mysql-community-devel-8.0.18-1.el7.x86_64 42/44
Installing : mysql-community-server-8.0.18-1.el7.x86_64 43/44
Installing : mysql-community-libs-compat-8.0.18-1.el7.x86_64 44/44
Verifying : perl-HTTP-Tiny-0.033-3.el7.noarch 1/44
Verifying : libselinux-devel-2.5-15.el7.x86_64 2/44
Verifying : keyutils-libs-devel-1.5.8-3.el7.x86_64 3/44
Verifying : 1:perl-Pod-Escapes-1.04-297.el7.noarch 4/44
Verifying : perl-threads-shared-1.43-6.el7.x86_64 5/44
Verifying : perl-Storable-2.45-3.el7.x86_64 6/44
Verifying : 4:perl-libs-5.16.3-297.el7.x86_64 7/44
Verifying : perl-Exporter-5.68-3.el7.noarch 8/44
Verifying : perl-constant-1.27-2.el7.noarch 9/44
Verifying : perl-PathTools-3.40-5.el7.x86_64 10/44
Verifying : perl-Socket-2.010-5.el7.x86_64 11/44
Verifying : libkadm5-1.15.1-50.el7.x86_64 12/44
Verifying : 1:perl-parent-0.225-244.el7.noarch 13/44
Verifying : libverto-devel-0.2.5-4.el7.x86_64 14/44
Verifying : zlib-devel-1.2.7-18.el7.x86_64 15/44
Verifying : mysql-community-server-8.0.18-1.el7.x86_64 16/44
Verifying : perl-File-Temp-0.23.01-3.el7.noarch 17/44
Verifying : net-tools-2.0-0.25.20131004git.el7.x86_64 18/44
Verifying : 1:perl-Pod-Simple-3.28-4.el7.noarch 19/44
Verifying : mysql-community-libs-8.0.18-1.el7.x86_64 20/44
Verifying : perl-Time-Local-1.2300-2.el7.noarch 21/44
Verifying : perl-Encode-2.51-7.el7.x86_64 22/44
Verifying : perl-Carp-1.26-244.el7.noarch 23/44
Verifying : 4:perl-Time-HiRes-1.9725-3.el7.x86_64 24/44
Verifying : 1:openssl-devel-1.0.2k-19.el7.x86_64 25/44
Verifying : perl-Scalar-List-Utils-1.27-248.el7.x86_64 26/44
Verifying : mysql-community-libs-compat-8.0.18-1.el7.x86_64 27/44
Verifying : libsepol-devel-2.5-10.el7.x86_64 28/44
Verifying : perl-Pod-Usage-1.63-3.el7.noarch 29/44
Verifying : mysql-community-client-8.0.18-1.el7.x86_64 30/44
Verifying : mysql-community-devel-8.0.18-1.el7.x86_64 31/44
Verifying : perl-Pod-Perldoc-3.20-4.el7.noarch 32/44
Verifying : perl-podlators-2.5.1-3.el7.noarch 33/44
Verifying : pcre-devel-8.32-17.el7.x86_64 34/44
Verifying : krb5-devel-1.15.1-50.el7.x86_64 35/44
Verifying : mysql-community-common-8.0.18-1.el7.x86_64 36/44
Verifying : perl-threads-1.87-4.el7.x86_64 37/44
Verifying : perl-Filter-1.49-3.el7.x86_64 38/44
Verifying : perl-Getopt-Long-2.40-3.el7.noarch 39/44
Verifying : perl-Text-ParseWords-3.29-4.el7.noarch 40/44
Verifying : libcom_err-devel-1.42.9-19.el7.x86_64 41/44
Verifying : perl-File-Path-2.09-2.el7.noarch 42/44
Verifying : 4:perl-5.16.3-297.el7.x86_64 43/44
Verifying : 4:perl-macros-5.16.3-297.el7.x86_64 44/44
Installed:
mysql-community-client.x86_64 0:8.0.18-1.el7 mysql-community-common.x86_64 0:8.0.18-1.el7 mysql-community-devel.x86_64 0:8.0.18-1.el7
mysql-community-libs.x86_64 0:8.0.18-1.el7 mysql-community-libs-compat.x86_64 0:8.0.18-1.el7 mysql-community-server.x86_64 0:8.0.18-1.el7
Dependency Installed:
keyutils-libs-devel.x86_64 0:1.5.8-3.el7 krb5-devel.x86_64 0:1.15.1-50.el7 libcom_err-devel.x86_64 0:1.42.9-19.el7
libkadm5.x86_64 0:1.15.1-50.el7 libselinux-devel.x86_64 0:2.5-15.el7 libsepol-devel.x86_64 0:2.5-10.el7
libverto-devel.x86_64 0:0.2.5-4.el7 net-tools.x86_64 0:2.0-0.25.20131004git.el7 openssl-devel.x86_64 1:1.0.2k-19.el7
pcre-devel.x86_64 0:8.32-17.el7 perl.x86_64 4:5.16.3-297.el7 perl-Carp.noarch 0:1.26-244.el7
perl-Encode.x86_64 0:2.51-7.el7 perl-Exporter.noarch 0:5.68-3.el7 perl-File-Path.noarch 0:2.09-2.el7
perl-File-Temp.noarch 0:0.23.01-3.el7 perl-Filter.x86_64 0:1.49-3.el7 perl-Getopt-Long.noarch 0:2.40-3.el7
perl-HTTP-Tiny.noarch 0:0.033-3.el7 perl-PathTools.x86_64 0:3.40-5.el7 perl-Pod-Escapes.noarch 1:1.04-297.el7
perl-Pod-Perldoc.noarch 0:3.20-4.el7 perl-Pod-Simple.noarch 1:3.28-4.el7 perl-Pod-Usage.noarch 0:1.63-3.el7
perl-Scalar-List-Utils.x86_64 0:1.27-248.el7 perl-Socket.x86_64 0:2.010-5.el7 perl-Storable.x86_64 0:2.45-3.el7
perl-Text-ParseWords.noarch 0:3.29-4.el7 perl-Time-HiRes.x86_64 4:1.9725-3.el7 perl-Time-Local.noarch 0:1.2300-2.el7
perl-constant.noarch 0:1.27-2.el7 perl-libs.x86_64 4:5.16.3-297.el7 perl-macros.x86_64 4:5.16.3-297.el7
perl-parent.noarch 1:0.225-244.el7 perl-podlators.noarch 0:2.5.1-3.el7 perl-threads.x86_64 0:1.87-4.el7
perl-threads-shared.x86_64 0:1.43-6.el7 zlib-devel.x86_64 0:1.2.7-18.el7
Complete!
#启动实例
[root@localhost ~]# systemctl --now enable mysqld
#默认的管理员密码在日志中, 此处读取日志中管理员密码登录并修改管理员密码
[root@localhost ~]# mysql -u root -p`grep 'temporary password' /var/log/mysqld.log|tail -1 |awk '{print $NF}'`
mysql: [Warning] Using a password on the command line interface can be insecure.
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 8
Server version: 8.0.18
Copyright (c) 2000, 2019, 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> set password='Root_1qaz';
Query OK, 0 rows affected (0.00 sec)
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> create table t1(c1 int);
Query OK, 0 rows affected (0.01 sec)
mysql> insert into t1 values(1),(2);
Query OK, 2 rows affected (0.00 sec)
Records: 2 Duplicates: 0 Warnings: 0
mysql> commit;
Query OK, 0 rows affected (0.00 sec)
二 查看当前版本
版本为 8.0.18
[root@localhost ~]# mysql -u root -pRoot_1qaz -e "select @@version"
mysql: [Warning] Using a password on the command line interface can be insecure.
+-----------+
| @@version |
+-----------+
| 8.0.18 |
+-----------+
三 升级到8.0.25
#关闭实例
[root@localhost ~]# systemctl stop mysqld
#备份一下
[root@localhost ~]# cp -a /var/lib/mysql /var/lib/mysql.$(date +%Y%m%d%H%M%S)
#解压安装包
[root@localhost ~]# tar -xvf mysql-8.0.32-1.el7.x86_64.rpm-bundle.tar
mysql-community-client-8.0.32-1.el7.x86_64.rpm
mysql-community-client-plugins-8.0.32-1.el7.x86_64.rpm
mysql-community-common-8.0.32-1.el7.x86_64.rpm
mysql-community-devel-8.0.32-1.el7.x86_64.rpm
mysql-community-embedded-compat-8.0.32-1.el7.x86_64.rpm
mysql-community-icu-data-files-8.0.32-1.el7.x86_64.rpm
mysql-community-libs-8.0.32-1.el7.x86_64.rpm
mysql-community-libs-compat-8.0.32-1.el7.x86_64.rpm
mysql-community-server-8.0.32-1.el7.x86_64.rpm
#升级 先卸载冲突的旧版本, 不冲突的可以直接升级
[root@localhost ~]# yum -y remove mysql-community-client-8.0.18
Loaded plugins: fastestmirror
Resolving Dependencies
--> Running transaction check
---> Package mysql-community-client.x86_64 0:8.0.18-1.el7 will be erased
--> Processing Dependency: mysql-community-client(x86-64) >= 8.0.11 for package: mysql-community-server-8.0.18-1.el7.x86_64
--> Running transaction check
---> Package mysql-community-server.x86_64 0:8.0.18-1.el7 will be erased
--> Finished Dependency Resolution
Dependencies Resolved
===================================================================================================================================================
Package Arch Version Repository Size
===================================================================================================================================================
Removing:
mysql-community-client x86_64 8.0.18-1.el7 @/mysql-community-client-8.0.18-1.el7.x86_64 177 M
Removing for dependencies:
mysql-community-server x86_64 8.0.18-1.el7 @/mysql-community-server-8.0.18-1.el7.x86_64 1.9 G
Transaction Summary
===================================================================================================================================================
Remove 1 Package (+1 Dependent package)
Installed size: 2.1 G
Downloading packages:
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
Erasing : mysql-community-server-8.0.18-1.el7.x86_64 1/2
Erasing : mysql-community-client-8.0.18-1.el7.x86_64 2/2
Verifying : mysql-community-client-8.0.18-1.el7.x86_64 1/2
Verifying : mysql-community-server-8.0.18-1.el7.x86_64 2/2
Removed:
mysql-community-client.x86_64 0:8.0.18-1.el7
Dependency Removed:
mysql-community-server.x86_64 0:8.0.18-1.el7
Complete!
[root@localhost ~]# yum -y install mysql-community-{icu-data-files,client-plugins}-8.0.32-1.el7.x86_64.rpm
Loaded plugins: fastestmirror
Examining mysql-community-icu-data-files-8.0.32-1.el7.x86_64.rpm: mysql-community-icu-data-files-8.0.32-1.el7.x86_64
Marking mysql-community-icu-data-files-8.0.32-1.el7.x86_64.rpm to be installed
Examining mysql-community-client-plugins-8.0.32-1.el7.x86_64.rpm: mysql-community-client-plugins-8.0.32-1.el7.x86_64
Marking mysql-community-client-plugins-8.0.32-1.el7.x86_64.rpm to be installed
Resolving Dependencies
--> Running transaction check
---> Package mysql-community-client-plugins.x86_64 0:8.0.32-1.el7 will be installed
---> Package mysql-community-icu-data-files.x86_64 0:8.0.32-1.el7 will be installed
--> Finished Dependency Resolution
Dependencies Resolved
===================================================================================================================================================
Package Arch Version Repository Size
===================================================================================================================================================
Installing:
mysql-community-client-plugins x86_64 8.0.32-1.el7 /mysql-community-client-plugins-8.0.32-1.el7.x86_64 14 M
mysql-community-icu-data-files x86_64 8.0.32-1.el7 /mysql-community-icu-data-files-8.0.32-1.el7.x86_64 3.5 M
Transaction Summary
===================================================================================================================================================
Install 2 Packages
Total size: 17 M
Installed size: 17 M
Downloading packages:
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
Installing : mysql-community-client-plugins-8.0.32-1.el7.x86_64 1/2
Installing : mysql-community-icu-data-files-8.0.32-1.el7.x86_64 2/2
Verifying : mysql-community-icu-data-files-8.0.32-1.el7.x86_64 1/2
Verifying : mysql-community-client-plugins-8.0.32-1.el7.x86_64 2/2
Installed:
mysql-community-client-plugins.x86_64 0:8.0.32-1.el7 mysql-community-icu-data-files.x86_64 0:8.0.32-1.el7
Complete!
[root@localhost ~]# yum -y upgrade mysql-community-{server,client,common,libs}-8.0.32-1.el7.x86_64.rpm
Loaded plugins: fastestmirror
Examining mysql-community-server-8.0.32-1.el7.x86_64.rpm: mysql-community-server-8.0.32-1.el7.x86_64
Package mysql-community-server not installed, cannot update it. Run yum install to install it instead.
Examining mysql-community-client-8.0.32-1.el7.x86_64.rpm: mysql-community-client-8.0.32-1.el7.x86_64
Package mysql-community-client not installed, cannot update it. Run yum install to install it instead.
Examining mysql-community-common-8.0.32-1.el7.x86_64.rpm: mysql-community-common-8.0.32-1.el7.x86_64
Marking mysql-community-common-8.0.32-1.el7.x86_64.rpm as an update to mysql-community-common-8.0.18-1.el7.x86_64
Examining mysql-community-libs-8.0.32-1.el7.x86_64.rpm: mysql-community-libs-8.0.32-1.el7.x86_64
Marking mysql-community-libs-8.0.32-1.el7.x86_64.rpm as an update to mysql-community-libs-8.0.18-1.el7.x86_64
Resolving Dependencies
--> Running transaction check
---> Package mysql-community-common.x86_64 0:8.0.18-1.el7 will be updated
---> Package mysql-community-common.x86_64 0:8.0.32-1.el7 will be an update
---> Package mysql-community-libs.x86_64 0:8.0.18-1.el7 will be updated
---> Package mysql-community-libs.x86_64 0:8.0.32-1.el7 will be an update
--> Finished Dependency Resolution
Dependencies Resolved
===================================================================================================================================================
Package Arch Version Repository Size
===================================================================================================================================================
Updating:
mysql-community-common x86_64 8.0.32-1.el7 /mysql-community-common-8.0.32-1.el7.x86_64 10 M
mysql-community-libs x86_64 8.0.32-1.el7 /mysql-community-libs-8.0.32-1.el7.x86_64 7.6 M
Transaction Summary
===================================================================================================================================================
Upgrade 2 Packages
Total size: 18 M
Downloading packages:
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
Updating : mysql-community-common-8.0.32-1.el7.x86_64 1/4
Updating : mysql-community-libs-8.0.32-1.el7.x86_64 2/4
Cleanup : mysql-community-libs-8.0.18-1.el7.x86_64 3/4
Cleanup : mysql-community-common-8.0.18-1.el7.x86_64 4/4
Verifying : mysql-community-common-8.0.32-1.el7.x86_64 1/4
Verifying : mysql-community-libs-8.0.32-1.el7.x86_64 2/4
Verifying : mysql-community-common-8.0.18-1.el7.x86_64 3/4
Verifying : mysql-community-libs-8.0.18-1.el7.x86_64 4/4
Updated:
mysql-community-common.x86_64 0:8.0.32-1.el7 mysql-community-libs.x86_64 0:8.0.32-1.el7
Complete!
查看升级后版本
[root@localhost ~]# mysql -u root -pRoot_1qaz -e "select @@version"
mysql: [Warning] Using a password on the command line interface can be insecure.
+-----------+
| @@version |
+-----------+
| 8.0.32 |
+-----------+
[root@localhost ~]# mysql -u root -pRoot_1qaz -e "select * from mysql.t1"
mysql: [Warning] Using a password on the command line interface can be insecure.
+------+
| c1 |
+------+
| 1 |
| 2 |
+------+
查看升级日志
[root@localhost ~]# grep upgrade /var/log/mysqld.log
2023-04-10T10:40:42.340183Z 1 [System] [MY-013413] [Server] Data dictionary upgrade from version '80017' to '80023' completed.
2023-04-10T10:40:43.326728Z 4 [System] [MY-013381] [Server] Server upgrade from '80018' to '80032' started.
2023-04-10T10:40:45.517257Z 4 [System] [MY-013381] [Server] Server upgrade from '80018' to '80032' completed.
升级成功了, 以前相邻版本升级直接使用 yum upgrade 就可以了, 这次可能是版本间隔比较大,新旧版本冲突了,需要先卸载就版本再安装新版本(不冲突的可以不卸载,直接升级)