参考博文: iptables防火墙只允许指定ip连接指定端口.访问指定网站 一.配置防火墙 打开配置文件 [root@localhost ~]# vi /etc/sysconfig/iptables 正确的配置文件 # Firewall configuration written by system-config-firewall # Manual customization of this file is not recommended. *filter :INPUT ACCEPT [:] :
解决mysql中只能通过localhost访问不能通过ip访问的问题 原因是没开权限 SELECT * FROM USER WHERE USER='root'; grant all privileges on *.* to 'root'@'%' identified by '123456';flush privileges; 1. 命令行进入mysql(假设root用户的密码也为root)mysql –uroot –proot 2. 使用mysql数据库use mysql; 3. 赋予权限gra