先卸载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
以上两步操作不可省略,否则执行以下命令会安装 mariadb,而非mysql
# yum -y install mysql-server mysql-devel
启动服务
systemctl start mysqld.service
初次安装mysql是root账户是没有密码的
设置密码的方法
# mysql -u root
mysql>
set
password
for
'root'@'localhost' = password(
'mypas
swd');
完成!