+91 88 00 563434 [email protected] Blog open-book Knowledge Base

Find Solutions in Our Knowledge Base

How to Enable Remote MySQL Connection in WHM?

You are here:
Sharing is Caring

By default, WHM disables remote connections to MySQL on all cPanel servers. Hosting servers with large websites often encounter problems due to the high resource usage of MySQL. This can result in server load and slow performance. To mitigate this issue, it is recommended to set up a remote MySQL connection. WHM provides the option to enable this feature. Follow the steps below to activate remote MySQL connection in WHM.

Steps to enable MySQL connection

1) Login to WHM server.

2) Go to the ‘SQL Services’ section and find the option ‘Additional MySQL Access Hosts’.

3) Input the IP or hostname from which you want to remotely connect to the MySQL server in the provided text box.

Remote MySQL

4) Click the ‘Save’ button to apply the changes.

5) To enable remote MySQL connection for all cPanel users, use the ‘Click here’ option.

Remote MySQL

Allowing remote host IP in server firewall

1) Login to your server using SSH.

2) Use the following command to whitelist the remote IP in the csf firewall:

# csf -a <IP>

3) Restart csf to enable the changes.

# csf -r

Steps from WHM:

1) Login to WHM.

2) In the ‘Plugins’ section, find and click on ‘ConfigServer Security & Firewall’.

3) To whitelist an IP address in the csf.allow file, enter the IP that you want to whitelist in the ‘Quick Allow’ section along with a comment explaining the allow action.

4) Click the ‘Quick Allow’ button to save the changes.
Enabling MySQL remote connections from cPanel

1) Log in to your cPanel interface.

2) Navigate to the ‘Databases’ section and locate the ‘Remote MySQL’ icon.

3) Enter the desired remote host name or IP address in the provided text box.

4) Click the ‘Add Host’ button to add the IP to the remote host list.

Now you can log in to the remote MySQL server from the allowed host in the WHM server.


Sharing is Caring

Leave a Comment

Table of Contents