mysql二进制方式升级8.0.34

阿里云国内75折 回扣 微信号:monov8
阿里云国际,腾讯云国际,低至75折。AWS 93折 免费开户实名账号 代冲值 优惠多多 微信号:monov8 飞机:@monov6

一、概述

mysql8.0.33 存在如下高危漏洞需要通过升级版本修复漏洞

Oracle MySQL Cluster 安全漏洞(CVE-2023-0361) mysql/8.0.33  Apache Skywalking <=8.3 SQL注入漏洞

 

二、查看mysql版本及安装包信息

[root@localhost mysql]# mysql -V
mysql  Ver 8.0.33 for Linux on x86_64 (MySQL Community Server - GPL)
[root@localhost mysql]# 
[root@localhost mysql]# rpm -qa|grep mysql
[root@localhost mysql]# ps -ef|grep mysql
mysql     290614       1  0 7月11 ?       00:00:00 /bin/sh /opt/mysql/mysql_base/bin/mysqld_safe --defaults-file=/etc/my.cnf
mysql     291491  290614  2 7月11 ?       14:48:00 /opt/mysql/mysql_base/bin/mysqld --defaults-file=/etc/my.cnf --basedir=/opt/mysql/mysql_base --datadir=/opt/mysql/data --plugin-dir=/opt/mysql/mysql_base/lib/plugin --log-error=err.log --open-files-limit=65535 --pid-file=localhost.localdomain.pid --socket=/opt/mysql/data/mysql.sock --port=3306
root     3002932 2950183  0 11:09 pts/0    00:00:00 grep --color=auto mysql
[root@localhost mysql]# 

三、下载升级包

复制如下浏览器

https://dev.mysql.com/get/Downloads/MySQL-8.0/mysql-8.0.34-linux-glibc2.12-x86_64.tar.xz

下载这个安装包

mysql-8.0.34-linux-glibc2.12-x86_64.tar.xz

四、升级mysql版本

##mysqldump备份数据库
省略

##关闭数据库
[mysql@localhost mysql]$ mysqladmin -uroot -p'密码' shutdown
mysqladmin: [Warning] Using a password on the command line interface can be insecure.
[mysql@localhost mysql]$ ps -ef|grep mysql
root     3003230 2950183  0 11:12 pts/0    00:00:00 su - mysql
mysql    3003231 3003230  0 11:12 pts/0    00:00:00 -bash
mysql    3003305 3003231  0 11:13 pts/0    00:00:00 ps -ef
mysql    3003306 3003231  0 11:13 pts/0    00:00:00 grep --color=auto mysql
[mysql@localhost mysql]$ 

##解压安装包
[root@localhost mysql]# xz -d mysql-8.0.34-linux-glibc2.12-x86_64.tar.xz
[root@localhost mysql]# tar -xf mysql-8.0.34-linux-glibc2.12-x86_64.tar 
[root@localhost mysql]# chown -R mysql.mysql mysql-8.0.34-linux-glibc2.12-x86_64
[root@localhost mysql]# su - mysql

##替换前
[mysql@localhost mysql]$ ls -lrt mysql_base
lrwxrwxrwx 1 mysql mysql 35 5月  10 19:54 mysql_base -> mysql-8.0.33-linux-glibc2.12-x86_64
[mysql@localhost mysql]$ 

##删除软链接
[mysql@localhost mysql]$ rm -rf mysql_base

##使用新版本创建软链接
[mysql@localhost mysql]$ ln -sf mysql-8.0.34-linux-glibc2.12-x86_64 mysql_base
[mysql@localhost mysql]$ ls -lrt mysql_base
lrwxrwxrwx 1 mysql mysql 35 8月   6 11:20 mysql_base -> mysql-8.0.34-linux-glibc2.12-x86_64
[mysql@localhost mysql]$ 



##启动数据库
[mysql@localhost mysql]$ /opt/mysql/mysql_base/bin/mysqld_safe --datadir=/opt/mysql/data &

##查看进程
[mysql@localhost mysql]$ ps -ef|grep mysql
root     3004011 2950183  0 11:20 pts/0    00:00:00 su - mysql
mysql    3004012 3004011  0 11:20 pts/0    00:00:00 -bash
mysql    3004164 3004012  0 11:21 pts/0    00:00:00 /bin/sh /opt/mysql/mysql_base/bin/mysqld_safe --datadir=/opt/mysql/data
mysql    3005043 3004164 48 11:21 pts/0    00:00:15 /opt/mysql/mysql_base/bin/mysqld --basedir=/opt/mysql/mysql_base --datadir=/opt/mysql/data --plugin-dir=/opt/mysql/mysql_base/lib/plugin --log-error=err.log --open-files-limit=65535 --pid-file=localhost.localdomain.pid --socket=/opt/mysql/data/mysql.sock --port=3306
mysql    3005366 3004012  0 11:22 pts/0    00:00:00 ps -ef
mysql    3005367 3004012  0 11:22 pts/0    00:00:00 grep --color=auto mysql
[mysql@localhost mysql]$ 


##查看数据库版本
[mysql@localhost mysql]$ mysql -V
mysql  Ver 8.0.34 for Linux on x86_64 (MySQL Community Server - GPL)
[mysql@localhost mysql]$ 


阿里云国内75折 回扣 微信号:monov8
阿里云国际,腾讯云国际,低至75折。AWS 93折 免费开户实名账号 代冲值 优惠多多 微信号:monov8 飞机:@monov6
标签: mysql