Setup Remote MySQL Server
For WHM version 11.40
(Home >> SQL Services >> Setup Remote MySQL Server)
This feature allows you to place your MySQL databases on a remote cPanel & WHM server that runs MySQL. A separate server for MySQL can be useful for busy servers or servers with large databases. You can offload MySQL-related work to the remote MySQL server.
This feature does not automatically transfer your MySQL data. Instead, it configures the remote server to work with your MySQL setup. After you configure the remote server, you will need to manually transfer your existing MySQL data, but any new databases you create will reside on the remote MySQL server.
: Do not confuse this feature with the ability to allow access to a MySQL database from a remote server. To configure that option, use the Additional MySQL Access Hosts
A remote MySQL server works best when it corresponds to a single cPanel server configuration. While it is possible to use a single remote MySQL server for multiple cPanel servers, we do not
recommend this configuration.
Install openssh-clients package
Before you set up a remote MySQL server, ensure that the
package is installed on your server. You will not be able to set up a Remote MySQL Server if this package is not installed.
To determine whether the
package is installed on your server, run the following command:
rpm -q openssh-clients
If the package is installed, the output will resemble the following:
package is not installed, the output will resemble the following:
package openssh-clients is not installed.
To install the
package, run the following command as the
yum install openssh-clients
Make certain that the local server's hostname resolves
Before you set up a remote MySQL server, ensure that the remote server resolves your local server's IP address
to its hostname
. You also need to ensure that the local server resolves your remote server's IP address
to its hostname
To confirm this, run the
command on the remote server through the command line.
root@server [~]# host 192.168.0.20
18.104.22.168.in-addr.arpa domain name pointer host.example.com.
: This command resolves the hostname
from the IP address
If you have not set up reverse DNS
, you will need to edit
on the remote MySQL server and add an entry for your local server, with the IP address
. This will perform the hostname
lookup manually, rather than through the DNS
Set up the remote MySQL server
To set up a remote MySQL server, perform the following steps:
- If it is not already installed on your remote server, install MySQL.
- Add the MySQL user's
root password for the
mysql user to the
- Review the displayed information, and enter the appropriate data:
- Remote server address — Specifies the IP address or fully qualified domain name (FQDN) of the remote server.
Note: You must specify FQDNs in lowercase letters.
- Remote SSH port — Specifies the SSH port for the remote server. The default is
- Login as — Specifies the login name.
Note: You can only use the
root account with this feature.
- Select authentication method — Specifies whether to use an SSH key or password to log in to the remote server.
- Select an installed SSH Key — Specifies an SSH key that will allow you to log in to the account. This option will only appear if Public Key is selected from the Select authentication method. menu. Secure servers will often require an SSH key, because keys are generally more secure than passwords.
- SSH Key Password — Specifies a password for the key, if one is required. This option will only appear if Public Key is selected from the Select authentication method. menu.
- Root Password — Specifies the password that you should use when you log in as the
- To finish the process, click Setup.
Terminate remote MySQL service
If your server currently uses a remote MySQL server, and you wish to return to a local MySQL server, perform the following steps:
localhost in the Remote server address text box.
- Click Setup.