1 my.cnf配置文件中的[mysqld]区域添加skip-name-resolve,即跳过mysql连接的DNS反向解析功能,这样能很好地提高mysql性能。在这种情况下,就只能使用MySQL授权表中的IP来连接mysql服务了。
另外:
如果在my.cnf文件中配置了bind-address地址绑定的地址(说明别的机器远程只能通过这个绑定的本机地址来连接mysql),可以将其注释掉。
例如:
bind-address = 127.0.0.1 //说明只能在本机连接mysql,并且通过-h 127.0.0.1或localhost,在远程是无法连接这个mysql的!
my.cnf配置的几个参数:
skip-name-resolve 跳过DNS反向解析过程.(这样就不能使用主机名连接mysql了,只能使用ip连接)
skip-grant-tables 跳过授权表(当mysql登陆密码忘记时的解决办法)
skip-networking 跳过TCP/IP连接
skip-host-cache 禁用主机名缓存;要想清除主机名缓存,执行FLUSH HOSTS语句或执行mysqladmin flush-hosts命令
xshell中配置隧道 主机为公用IP。
2:查看防火状态
systemctl status firewalld
service iptables status
3:暂时关闭防火墙
systemctl stop firewalld
service iptables stop
4 永久关闭防火墙
systemctl disable firewalld
chkconfig iptables off
5:重启防火墙
systemctl enable firewalld
service iptables restart
6:永久关闭后重启
chkconfig iptables on