How to allow remote MySql connection to only one IP?

There may be a case in which one of the cPanel user request you to provide access to Mysql remotely. You probably can't open MySql port 3306 on the server because that would lead to security risks. So in such case follow below steps -
 
Step 1:
Login to cPanel >> Remote Mysql >> Add remote server's IP address under Add access host >> Click Add host.

Step 2 :
Open mysql port for the remote IP address. To do this update below csf file (firewall) -

nano /etc/csf/csf.allow
tcp|in|d=3306|s=x.x.x.x (Replace x.x.x.x with remote server IP)

Now, remote IP x.x.x.x will be able to access Mysql on your server.
  • 0 Users Found This Useful
Was this answer helpful?

Related Articles

How to resolve the issue of WordPress site which downloads PHP files instead of parsing after cPanel migration?

After migrating the WordPress site on the cPanel server, the website was not loading, it was...

Database connection error (2): Could not connect to MySQL- Joomla Issue

While accessing the Joomla site I was getting the error as "Database connection error (2): Could...

How to Install cPanel on CentOS 6 or 7?

How to install cPanel on CentOS 6 or 7.  Please note cPanel does not support any other operating...

How to to know SSH port on the cPanel server?

Steps to know SSH port of cPanel server -1. Login to WHM with your login details. 2. Go to...

The MySQL server is currently offline. Mysql::initcache() failed: The mysql server is offline.

I was getting below error while accessing MySQL Databases from cPanel though MySQL service was...

Powered by WHMCompleteSolution