本文以mysql 5.6.35版本为例,讲述centos7_x64下mysql安装过程。
一、安装mysql源
wget http://repo.mysql.com/mysql-community-release-el7-5.noarch.rpm
rpm -ivh mysql-community-release-el7-5.noarch.rpm
注:centos7下未提供mysql,需要自行获取repo源,mysql被oracle收购,开源版本为mariadb
二、安装mysql
wget http://repo.mysql.com/mysql-community-release-el7-5.noarch.rpm
rpm -ivh mysql-community-release-el7-5.noarch.rpm
三、安装mysql库(非必需)
yum install mysql-devel //如需编译使用依赖mysql库相关的服务,需要安装
四、配置mysql
mysql -uroot //登陆mysql,默认安装密码为空
use mysql; //切换数据库
update user set password=password('123456') where user='root'; //修改密码为"123456"
GRANT ALL ON *.* TO root@'%' IDENTIFIED BY '123456'; //权限配置
FLUSH PRIVILEGES;
exit
下篇将讲述centos7下防火墙配置