vi /etc/sysconfig/iptables
-A RH-Firewall-1-INPUT -i eth1 -p tcp -s 內網網段/24 --dport 3306 -j ACCEPT
-A RH-Firewall-1-INPUT -i eth0 -p tcp -s 外網網段/24 --dport 3306 -j ACCEPT
mysql -p
CREATE USER 'root'@'10.20.%.%';
GRANT ALL PRIVILEGES ON * . * TO 'root'@'10.20.%.%' IDENTIFIED BY '同localhost用的密碼';
flush privileges;
CREATE USER 'root'@'外網網段.%';
GRANT ALL PRIVILEGES ON * . * TO 'root'@'外網網段.%' IDENTIFIED BY '同localhost用的密碼';
flush privileges;
參考:
http://www.cyberciti.biz/tips/how-do-i-enable-remote-access-to-mysql-database-server.html
http://www.debianhelp.co.uk/remotemysql.htm
沒有留言:
張貼留言