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

Enable remote mysql

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

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


[root@server ~]# cat /etc/csf/csf.allow| grep 3306


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!!! These are the steps to enable remote mysql connection with csf.

What is isinstance function in Python?

This is a very important fn in Python programming. It returns a Boolean stating whether the object is an instance or subclass of another object. In this post, I am going to explain about Python function “isinstance” and its different examples.

Python is a good and simple language for SysAdmins automation tasks.

How to install and configure csf on CentOS/RHEL servers?

One of the most commonly using Firewall application on Linux servers. Config Server Security & Firewall is abbreviated as CSF. CSF helps to configure server firewall easily and simply. Here CryBit is going to explain how to install CSF and configure this on your Linux servers. Installation steps are simple and easy to execute.
Installation Steps

Step I : SSH to your server and do the following steps as root user.

Step II : Download CSF package. Read more…

Post navigation

Heba Habeeb

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

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

  1. Hi, will something like this work for OUTGOING?


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

Leave a Reply

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