contos7默认安装了mariadb数据库,这里把他移除:
yum remove mariadb-libs.x86_64
在官网获取下载链接然后下载
wget https://dev.mysql.com/get/mysql80-community-release-el7-1.noarch.rpm
yum localinstall mysql80-community-release-el7-1.noarch.rpm
接着安装mysql
yum install -y mysql-community-server
启动数据库
service mysqld start
查看启动mysql的临时密码
cat /var/log/mysqld.log | grep password
复制密码。登录数据库进行修改