Linux上mysql 5.7 小版本升级|rpm安装方式

1.环境说明

[ACCIT@TAQM-DB ~]$ cat /etc/redhat-release
Red Hat Enterprise Linux release 8.6 (Ootpa)
[ACCIT@TAQM-DB ~]$ mysqld -V
mysqld  Ver 5.7.22 for Linux on x86_64 (MySQL Community Server (GPL))

2.升级步骤

1.官网下载最新版本日拍卖安装包 MySQL :: Download MySQL Community Server (Archived Versions)

Linux上mysql 5.7 小版本升级|rpm安装方式_第1张图片

 2.查查看当前安装包

rpm -qa |grep mysql

[ACCIT@TAQM-DB ~]$ rpm -qa |grep mysql
mysql-community-libs-5.7.22-1.el7.x86_64
mysql-community-server-5.7.22-1.el7.x86_64
mysql-community-client-5.7.22-1.el7.x86_64
mysql-community-common-5.7.22-1.el7.x86_64

3.备份数据库 

备份数据

 mysqldump -u user_name -p123456 database_name > outfile_name.sql

备份配置

cp /etc/my.cnf /tmp/my.cnf.bak

4.关闭数据库

service mysqld stop

5.升级

1.解压安装包

[root@TAQM-DB packages]# mv /tmp/mysql-5.7.37-1.el7.x86_64.rpm-bundle.tar .
[root@TAQM-DB packages]# ls
mysql-5.7.37-1.el7.x86_64.rpm-bundle.tar
[root@TAQM-DB packages]# tar -xvf mysql-5.7.37-1.el7.x86_64.rpm-bundle.tar 
mysql-community-client-5.7.37-1.el7.x86_64.rpm
mysql-community-common-5.7.37-1.el7.x86_64.rpm
mysql-community-devel-5.7.37-1.el7.x86_64.rpm
mysql-community-embedded-5.7.37-1.el7.x86_64.rpm
mysql-community-embedded-compat-5.7.37-1.el7.x86_64.rpm
mysql-community-embedded-devel-5.7.37-1.el7.x86_64.rpm
mysql-community-libs-5.7.37-1.el7.x86_64.rpm
mysql-community-libs-compat-5.7.37-1.el7.x86_64.rpm
mysql-community-server-5.7.37-1.el7.x86_64.rpm
mysql-community-test-5.7.37-1.el7.x86_64.rpm
[root@TAQM-DB packages]# ls
mysql-5.7.37-1.el7.x86_64.rpm-bundle.tar        mysql-community-embedded-5.7.37-1.el7.x86_64.rpm         mysql-community-libs-compat-5.7.37-1.el7.x86_64.rpm
mysql-community-client-5.7.37-1.el7.x86_64.rpm  mysql-community-embedded-compat-5.7.37-1.el7.x86_64.rpm  mysql-community-server-5.7.37-1.el7.x86_64.rpm
mysql-community-common-5.7.37-1.el7.x86_64.rpm  mysql-community-embedded-devel-5.7.37-1.el7.x86_64.rpm   mysql-community-test-5.7.37-1.el7.x86_64.rpm
mysql-community-devel-5.7.37-1.el7.x86_64.rpm   mysql-community-libs-5.7.37-1.el7.x86_64.rpm

2.执行升级命令

rpm -Uvh --force --nodeps

rpm -Uvh mysql-community-server-5.7.37-1.el7.x86_64.rpm  --force --nodeps
rpm -Uvh mysql-community-libs-5.7.37-1.el7.x86_64.rpm --force --nodeps
rpm -Uvh mysql-community-common-5.7.37-1.el7.x86_64.rpm --force --nodeps
rpm -Uvh mysql-community-client-5.7.37-1.el7.x86_64.rpm --force --nodeps
  1. 执行mysql的升级检查命令
sudo mysql_upgrade -uroot -p

3.启动数据库

service mysqld start

4.查看MySQL版本

Linux上mysql 5.7 小版本升级|rpm安装方式_第2张图片

你可能感兴趣的:(大数据,mysql)