Hướng dẫn cách mở port MySQL cổng 3306 để kết nối từ 1 server khác
You need to open TCP port 3306 using iptables or BSD pf firewall.
A sample iptables rule to open Linux iptables firewall CODE
OR only allow remote connection from your web server located at 10.5.1.3: CODE
OR only allow remote connection from your lan subnet 192.168.1.0/24: CODE
Finally save all rules (RHEL / CentOS specific command): # service iptables save A sample FreeBSD / OpenBSD pf rule ( /etc/pf.conf) CODE
OR allow only access from your web server located at 10.5.1.3: CODE
Test it From your remote system or your desktop type the following command: CODE
Where, -u webadmin: webadmin is MySQL username -h IP or hostname: 65.55.55.2 is MySQL server IP address or hostname (FQDN) -p : Prompt for password You can also use the telnet or nc command to connect to port 3306 for testing purpose: CODE
OR CODE
Sample outputs: CODE
|
Thêm vào trang Google +
Số lần xem : 25582
Đánh giá