在这之前首先确保虚拟机上安装了两个能够联网且知道IP的Centos7系统
1. 安装MySQL
1.1 安装下载
检查是否安装了mysql
rpm -qa | grep mysql
如果安装了请卸载
yum remove mysql*
因为centos-7默认是Mariadb,所以执行以下命令只是更新Mariadb数据库,这里要下载mysql的源
wget http://repo.mysql.com/mysql-community-release-el7-5.noarch.rpm
安装mysql源
rpm -ivh mysql-community-release-el7-5.noarch.rpm
安装mysql
yum install mysql-server
检查是否有错误
rpm -qa |grep mysql
如果内容中有
Error: Package: mysql-community-libs-5.6.35-2.el7.x86_64 (mysql56-community)
Requires: libc.so.6(GLIBC_2.17)(64bit)
Error: Package: mysql-community-server-5.6.35-2.el7.x86_64 (mysql56-community)
Requires: libc.so.6(GLIBC_2.17)(64bit)
Error: Package: mysql-community-server-5.6.35-2.el7.x86_64 (mysql56-community)
Requires: systemd
Error: Package: mysql-community-server-5.6.35-2.el7.x86_64 (mysql56-community)
Requires: libstdc++.so.6(GLIBCXX_3.4.15)(64bit)
Error: Package: mysql-community-client-5.6.35-2.el7.x86_64 (mysql56-community)
Requires: libc.so.6(GLIBC_2.17)(64bit)
You could try using --skip-broken to work around the problem
You could try running: rpm -Va --nofiles --nodigest
解决办法: