准备好mysql的离线安装文件: MySql官网下载mysql-5.7.25-1.el7.x86_64.rpm-bundle,并复制到/usr/mysql文件夹中。 删除CentOS自带的MariaDB: rpm -qa|grep mariadb rpm -e --nodeps mariadb-libs rpm命令安装: cd /usr/mysql/ mysql-5.7.25-1.el7.x86_64.rpm-bundle rpm -ivh mysql-community-common-5.7.21-1.el7.x86_64.rpm rpm -ivh mysql-community-libs-5.7.21-1.el7.x86_64.rpm rpm -ivh mysql-community-devel-5.7.21-1.el7.x86_64.rpm rpm -ivh mysql-community-libs-compat-5.7.21-1.el7.x86_64.rpm rpm -ivh mysql-community-client-5.7.21-1.el7.x86_64.rpm rpm -ivh mysql-community-server-5.7.21-1.el7.x86_64.rpm 启动MySql服务: 查看MySql运行状态:service mysqld status