1.安装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
2.启动mysql
service mysqld restart
3.配置root用户密码
mysql -u root
set password for 'root'@'localhost' =password('your password!');
4.远程连接设置
grant all privileges on *.* to root@'%'identified by 'your password';
flush privileges;
5.开启3306端口
firewall-cmd --zone=public --add-port=3306/tcp --permanent
systemctl restart firewalld.service