Mysql安装
# 1. 安装mysql-community-release-el7-5.noarch.rpm包
wget http://repo.mysql.com/mysql-community-release-el7-5.noarch.rpm
# 2. 安装MySQL
sudo rpm -ivh mysql-community-release-el7-5.noarch.rpm
# 3.
sudo yum install mysql-server
# 4. 启动mysql服务
service mysql start
# 5. 设置mysql用户密码
set password for 'root'@'localhost'=password('root');
# 6. 设置远程登陆
use mysql
grant all privileges on *.* to root@'%' identified by 'root';
flush privileges;
# 7.
select host,user,password from user;
注意点,需要关闭防火墙,远程连接才能够成功
firewall-cmd --state
systemctl stop firewalld.service # 临时关闭防火墙