CentOS7安装mysql

2016年02月20日

CentOS7中Mysql的安装步骤

1.删除mariadb

[root@ip-10-167-141-167 centos]# yum list installed | grep maria
mariadb-libs.x86_64                        1:5.5.44-2.el7.centos       @base    
[root@ip-10-167-141-167 centos]# yum -y remove mariadb-libs
[root@ip-10-167-141-167 centos]# 

2.安装

[root@ip-10-167-141-167 centos]# yum -y install http://dev.mysql.com/get/mysql-community-release-el7-5.noarch.rpm
[root@ip-10-167-141-167 centos]# yum -y install mysql mysql-devel mysql-server mysql-utilities

3.启动Mysql

[root@ip-10-167-141-167 centos]# systemctl is-enabled mysqld.service
enabled
#disable的情况下
[root@ip-10-167-141-167 centos]# systemctl enable mysqld.service
[root@ip-10-167-141-167 centos]# systemctl start mysqld.service

4.初始化DB

[root@ip-10-167-141-167 centos]# mysql_secure_installation