开通Mysql授权
MariaDB [(none)]>GRANT ALL PRIVILEGES ON *.* TO 'root'@'%' IDENTIFIED BY 'root' WITH GRANT OPTION;
MariaDB [(none)]>FLUSH PRIVILEGES;
root用户使用密码root从任何主机连接到mysql服务器
查看是否授权成功
MariaDB [(none)]> select host,user from mysql.user;
+-----------+------+
| host | user |
+-----------+------+
| % | root |
| 127.0.0.1 | root |
| ::1 | root |
| localhost | root |
+-----------+------+
4 rows in set (0.00 sec)
看到%|root这一行,说明授权成功
开放防火墙端口
编辑防火墙配置文件
vi /etc/sysconfig/iptables
开放ssh端口
#ssh port
-A INPUT -m state --state NEW -m tcp -p tcp --dport 22 -j ACCEPT
开放数据库的3306端口
#mysql port
-A INPUT -p tcp -m tcp --dport 3306 -j ACCEPT