One of the core components of hundreds of thousands of eCommerce apps and CMS (Content Management Systems) is the MySQL database. Generally, cPanel’s MySQL and website instances run on a single server.
Advantages of using a isolated MySQL server:
- Improvement in the efficiency of busy sites by offloading database workloads from the web servers.
- Servers can be explicitly configured to avail database services.
- Database management can be centralised for various servers.
- Databases that are accessible through an IP address (public) can be isolated from their servers. Even disabling the public IP also helps to increase the security.
- Many people expose their database server to the web for remote access and receive connections from unknown IPs. This may leave them vulnerable to data theft.
Requisites that you need:
- A server that has cPanel and WHM installed.
- cPanel authentication credentials, database server’s domain name or IP address, and MySQL credentials.
- Another server where the web applications will be installed.
- We will be using SSH if the sites are configured and installed manually via command line interface, but the process becomes much convenient and fast with cPanel.
Configuring the database (MySQL) with cPanel:
- Login into the server’s cPanel that you have chosen to have MySQL on and want the access to. Choose Remote MySQL from the menu on the main page.
- You’ll have to put the IP address or the web server’s domain name with the web applications in the Add Access Host form. A wildcard (%) can also be used to allow many IP (Internet Protocol) addresses to have access to the database. When using this feature, emphasise on restricting the scope of the addresses that you have under you, or you will face security risks.
- Next, by clicking on the button that says Add Host, you’ll let cPanel configure the database (MySQL) to take requests from the remote site.
- The next step would require you to configure your site to utilise the isolated database’s functionality. This process changes from user to user as the application changes.
Integrating MySQL Hosts (Access) to WHM:
MySQL can also be configured by system administrators to receive incoming connection requests from sites on other servers. Some of the differences in WHM and cPanel, where a remote database is concerned, are:
- All the cPanel and MySQL user accounts with the host included in WHM are applied within those records.
- The cPanel’s users can’t permanently delete hosts that the administrators add.
Go to Additional MySQL Access Hosts in the side menu where it says “SQL Services” to allow remote hosts to access MySQL databases.
Enter the IP addresses or domain names of the isolated hosts that you want to be permitted to make connections to the server's database, and then click Save.
Management of MySQL database profiles in the WHM:
Rather than just configuring remote/isolated databases in WHM and cPanel, MySQL profiles can also be created in WHM in order to join with remote/isolated database servers by the server administrators. It lets the administrators mark the database used all over cPanel and WHM. Moreover, the default database of the local machine is also configured with the help of a profile.
Before creating or activating a fresh profile, it is important to note that only a single profile can get activated at a given time. If you want to create a fresh profile, sign into WHM then go to Manage MySQL Profiles within SQL Services found in the side menu.
Once the profile is activated, new databases can be made on the isolated/remote server. However, you’ll have to transfer data manually since the existing databases don’t migrate automatically.
Conclusion:
Incredible flexibility is provided to the clients and hosts by cPanel and WHM where configuration and management of MySQL databases is concerned. Here are some of the advantages:
- For sites that are hosted on isolated/ separate servers, cPanel makes database configuration easy.
- Various system administration tools are provided that give admin power over MySQL databases and where the databases are located, respectively.