环境:Centos7、rpm方式
官方资源下载:mysql5.7.43、mysql5.7.44
查看当前服务器安装的MySQL版本
[root@s-zw-db-mysql-test ~]# rpm -qa|grep mysql mysql-community-common-5.7.19-1.el7.x86_64 mysql-community-client-5.7.19-1.el7.x86_64 mysql-community-libs-compat-5.7.19-1.el7.x86_64 mysql57-community-release-el7-9.noarch mysql-community-libs-5.7.19-1.el7.x86_64 mysql-community-server-5.7.19-1.el7.x86_64
停止MySQL服务
[root@s-zw-db-mysql-test ~]# systemctl stop mysqld
上传mysql5.7.43压缩包到服务器并解压
[root@s-zw-db-mysql-test ~]# tar -xvf mysql-5.7.43-1.el7.x86_64.rpm-bundle.tar
在解压后的文件夹中,执行升级命令
[root@s-zw-db-mysql-test ~]# rpm -Uvh mysql-community-server-5.7.43-1.el7.x86_64.rpm --force --nodeps [root@s-zw-db-mysql-test ~]# rpm -Uvh mysql-community-libs-5.7.43-1.el7.x86_64.rpm --force --nodeps [root@s-zw-db-mysql-test ~]# rpm -Uvh mysql-community-common-5.7.43-1.el7.x86_64.rpm --force --nodeps [root@s-zw-db-mysql-test ~]# rpm -Uvh mysql-community-client-5.7.43-1.el7.x86_64.rpm --force --nodeps
启动mysql服务
[root@s-zw-db-mysql-test ~]# systemctl start mysqld
链接数据库查看版本
[root@s-zw-db-mysql-test ~]# mysql -uhlwjzwfw -p Enter password: mysql> select version(); +------------+ | version() | +------------+ | 5.7.43 | +------------+ 1 row in set (0.00 sec)