centos7 MySQL 升级8.0.33

 

1、当前centos版本

 

2、当前mysql版本

 

 3、下载mysql离线安装包

https://dev.mysql.com/downloads/mysql/

 

 

1、备份数据库
[root@node42 ~]# mysqldump -uroot -p --all-databases >backupall.sql

 

2、关闭mysql
[root@node42 ~]# systemctl stop mysqld

 

3、上传RPM包
安装包解压:
[root@host-19-105-200-115 soft]# tar -xvf mysql-8.0.33-1.el7.x86_64.rpm-bundle.tar 

-rw------- 1 root root 1016227840 3月 7 10:09 mysql-8.0.32-1.el7.x86_64.rpm-bundle.tar
-rw------- 1 root root 1027983360 5月 8 12:17 mysql-8.0.33-1.el7.x86_64.rpm-bundle.tar
-rw-r--r-- 1 7155 31415 16972740 3月 17 17:28 mysql-community-client-8.0.33-1.el7.x86_64.rpm
-rw-r--r-- 1 7155 31415 3746004 3月 17 17:28 mysql-community-client-plugins-8.0.33-1.el7.x86_64.rpm
-rw-r--r-- 1 7155 31415 680276 3月 17 17:28 mysql-community-common-8.0.33-1.el7.x86_64.rpm
-rw-r--r-- 1 7155 31415 524492024 3月 17 17:29 mysql-community-debuginfo-8.0.33-1.el7.x86_64.rpm
-rw-r--r-- 1 7155 31415 1969188 3月 17 17:29 mysql-community-devel-8.0.33-1.el7.x86_64.rpm
-rw-r--r-- 1 7155 31415 4218852 3月 17 17:29 mysql-community-embedded-compat-8.0.33-1.el7.x86_64.rpm
-rw-r--r-- 1 7155 31415 2219168 3月 17 17:29 mysql-community-icu-data-files-8.0.33-1.el7.x86_64.rpm
-rw-r--r-- 1 7155 31415 1587536 3月 17 17:29 mysql-community-libs-8.0.33-1.el7.x86_64.rpm
-rw-r--r-- 1 7155 31415 686272 3月 17 17:29 mysql-community-libs-compat-8.0.33-1.el7.x86_64.rpm
-rw-r--r-- 1 7155 31415 67412732 3月 17 17:30 mysql-community-server-8.0.33-1.el7.x86_64.rpm
-rw-r--r-- 1 7155 31415 25518376 3月 17 17:30 mysql-community-server-debug-8.0.33-1.el7.x86_64.rpm
-rw-r--r-- 1 7155 31415 378469824 3月 17 17:32 mysql-community-test-8.0.33-1.el7.x86_64.rpm

 

 4、强制进行数据字典升级和服务升级安装【严格按照此顺序】

[root@host-19-105-200-115 soft]# rpm -ivh mysql-community-common-8.0.33-1.el7.x86_64.rpm --nodeps --force
警告:mysql-community-common-8.0.33-1.el7.x86_64.rpm: 头V4 RSA/SHA256 Signature, 密钥 ID 3a79bd29: NOKEY
准备中... ################################# [100%]
正在升级/安装...
1:mysql-community-common-8.0.33-1.e################################# [100%]
[root@host-19-105-200-115 soft]# rpm -ivh mysql-community-client-plugins-8.0.33-1.el7.x86_64.rpm --nodeps --force
警告:mysql-community-client-plugins-8.0.33-1.el7.x86_64.rpm: 头V4 RSA/SHA256 Signature, 密钥 ID 3a79bd29: NOKEY
准备中... ################################# [100%]
正在升级/安装...
1:mysql-community-client-plugins-8.################################# [100%]
[root@host-19-105-200-115 soft]# rpm -ivh mysql-community-libs-8.0.33-1.el7.x86_64.rpm --nodeps --force
警告:mysql-community-libs-8.0.33-1.el7.x86_64.rpm: 头V4 RSA/SHA256 Signature, 密钥 ID 3a79bd29: NOKEY
准备中... ################################# [100%]
正在升级/安装...
1:mysql-community-libs-8.0.33-1.el7################################# [100%]
[root@host-19-105-200-115 soft]# rpm -ivh mysql-community-client-8.0.33-1.el7.x86_64.rpm --nodeps --force
警告:mysql-community-client-8.0.33-1.el7.x86_64.rpm: 头V4 RSA/SHA256 Signature, 密钥 ID 3a79bd29: NOKEY
准备中... ################################# [100%]
正在升级/安装...
1:mysql-community-client-8.0.33-1.e################################# [100%]
[root@host-19-105-200-115 soft]# rpm -ivh mysql-community-icu-data-files-8.0.33-1.el7.x86_64.rpm --nodeps --force
警告:mysql-community-icu-data-files-8.0.33-1.el7.x86_64.rpm: 头V4 RSA/SHA256 Signature, 密钥 ID 3a79bd29: NOKEY
准备中... ################################# [100%]
正在升级/安装...
1:mysql-community-icu-data-files-8.################################# [100%]
[root@host-19-105-200-115 soft]# rpm -ivh mysql-community-server-8.0.33-1.el7.x86_64.rpm --nodeps --force
警告:mysql-community-server-8.0.33-1.el7.x86_64.rpm: 头V4 RSA/SHA256 Signature, 密钥 ID 3a79bd29: NOKEY
准备中... ################################# [100%]
正在升级/安装...
1:mysql-community-server-8.0.33-1.e################################# [100%]

 

5、查找已安装的mysql
[root@host-19-105-200-115 soft]# rpm -qa |grep mysql
mysql-community-server-8.0.33-1.el7.x86_64
mysql-community-server-8.0.32-1.el7.x86_64
mysql-community-libs-8.0.33-1.el7.x86_64
mysql-community-common-8.0.32-1.el7.x86_64
mysql-community-icu-data-files-8.0.32-1.el7.x86_64
mysql-community-client-8.0.33-1.el7.x86_64
mysql-community-libs-8.0.32-1.el7.x86_64
mysql-community-client-plugins-8.0.32-1.el7.x86_64
mysql-community-common-8.0.33-1.el7.x86_64
mysql-community-icu-data-files-8.0.33-1.el7.x86_64
mysql-community-client-8.0.32-1.el7.x86_64
mysql-community-client-plugins-8.0.33-1.el7.x86_64

 

6、删除查找到的上个版本的安装包【严格按照此顺序】

[root@host-19-105-200-115 soft]# rpm -e mysql-community-server-8.0.32-1.el7.x86_64
[root@host-19-105-200-115 soft]# rpm -e mysql-community-icu-data-files-8.0.32-1.el7.x86_64
[root@host-19-105-200-115 soft]# rpm -e mysql-community-client-8.0.32-1.el7.x86_64
[root@host-19-105-200-115 soft]# rpm -e mysql-community-libs-8.0.32-1.el7.x86_64
[root@host-19-105-200-115 soft]# rpm -e mysql-community-client-plugins-8.0.32-1.el7.x86_64
[root@host-19-105-200-115 soft]# rpm -e mysql-community-common-8.0.32-1.el7.x86_64
[root@host-19-105-200-115 soft]# rpm -qa |grep mysql
mysql-community-server-8.0.33-1.el7.x86_64
mysql-community-libs-8.0.33-1.el7.x86_64
mysql-community-client-8.0.33-1.el7.x86_64
mysql-community-common-8.0.33-1.el7.x86_64
mysql-community-icu-data-files-8.0.33-1.el7.x86_64
mysql-community-client-plugins-8.0.33-1.el7.x86_64

 

7、启动mysql
[root@host-19-105-200-115 ~]# systemctl start mysqld


8、查看是否启动

[root@host-19-105-200-115 ~]# ps -ef|grep mysql
mysql 16400 1 29 10:20 ? 00:00:06 /usr/sbin/mysqld
root 16711 13357 0 10:21 pts/0 00:00:00 grep --color=auto mysql

 

9、登录数据库查看版本

[root@host-19-105-200-115 ~]# mysql -u root -p
Enter password:
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 10
Server version: 8.0.33 MySQL Community Server - GPL

Copyright (c) 2000, 2023, 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> \s
--------------
mysql Ver 8.0.33 for Linux on x86_64 (MySQL Community Server - GPL)

Connection id: 10
Current database:
Current user: root@localhost
SSL: Not in use
Current pager: stdout
Using outfile: ''
Using delimiter: ;
Server version: 8.0.33 MySQL Community Server - GPL
Protocol version: 10
Connection: Localhost via UNIX socket
Server characterset: utf8mb4
Db characterset: utf8mb4
Client characterset: utf8mb4
Conn. characterset: utf8mb4
UNIX socket: /var/lib/mysql/mysql.sock
Binary data as: Hexadecimal
Uptime: 1 min 21 sec

Threads: 2 Questions: 11 Slow queries: 0 Opens: 557 Flush tables: 4 Open tables: 37 Queries per second avg: 0.135
--------------

posted @ 2023-05-09 10:36  明启  阅读(1762)  评论(0编辑  收藏  举报