How to enable remote MySQL for an IP address on a cPanel server via CSF

In CSF, there is an option to allow IP address in a file which is ‘csf.allow’ that allows connections from external. Please do follow the steps here for enabling remote MySQL for an IP address on a cPanel server.

Either you can white-list the IP address that you need to connect to the server or you can enable only a port for the specified IP address.

Step I : Enable the port 3306 only for the specific IP address:
This can be done in the CSF configuration file ‘/etc/csf/csf.allow‘

# vi /etc/csf/csf.allow
---
tcp:in:d=3306=x.x.x.x 
---

where x.x.x.x is your IP address

Example:

[[email protected] ~]# cat /etc/csf/csf.allow| grep 3306
tcp:in:d=3306=11.20.11.44

OR

White-list the IP address in the CSF

#csf -a x.x.x.x

Step II : Restart CSF

#csf -r

Step III : Add the IP address in remote MySQL in cPanel

a) Navigate to Databases section in cPanel
b) Click on Remote MySQL 
c) Add the IP address that you need to add in "Access Hosts"

That’s it!!!

Heba Habeeb

Working as a Linux Server Admin, Infopark, Cochin, Kerala.

You may also like...

3 Responses

  1. Chad says:

    Hi, will something like this work for OUTGOING?

    tcp:out:d=3306:s=127.0.0.0

    User wants his locally hosted domain to connect to an external server database on another host, via 3306.

  1. February 5, 2014

    […] How to enable remote MySQL for an IP address on a cPanel server via CSF How to upgrade MySQL from 5.1 to 5.5 in a cPanel server – command line option How to allow mysql […]

Leave a Reply

Your email address will not be published. Required fields are marked *