一、rpm 和 yum
先卸载mariadb
#列出所有被安装的mariadb
rpm -qa | grep mariadb
然后全部卸载
rpm -e --nodeps mariadb-libs-5.5.37-1.el7_0.x86_64
下载mysql安装包:
# wget http://dev.mysql.com/get/mysql-community-release-el7-5.noarch.rpm
# rpm -ivh mysql-community-release-el7-5.noarch.rpm
# yum install mysql-community-server
启动服务
systemctl start mysqld.service
初次安装mysql是root账户是没有密码的
设置密码的方法
# mysql -u root
mysql>
set
password
for
‘root’@‘localhost’ = password(
'mypas
swd');
完成!
二、简单安装方式:
yum -y install mysql-server mysql-devel 完成