Manage Database Profiles

Valid for versions 120 through 122

Version:

120

124

Last modified: August 14, 2024


Looking for this interface?
Note:

Your hosting provider can enable or disable this interface for resellers in WHM's Edit Reseller Nameservers and Privileges interface (WHM >> Home >> Resellers >> Edit Reseller Nameservers and Privileges).

Overview

This interface allows you to manage multiple MySQL® or MariaDB® profiles. A profile defines the connection information for a local or remote database server. The interface also allows you to set which profile is active. The active profile determines how the root database user connects to databases, as well as the location of newly-created users and databases.

Note:

In cPanel & WHM version 118 and earlier, we titled this interface Manage MySQL® Profiles and its section in the WHM interface SQL Services.

You may wish to use a remote server if, for example, you manage particularly busy servers or servers with large databases. You can offload database-related work to a remote database server.

Remote servers include other cPanel & WHM servers that run MariaDB or MySQL, a dedicated MariaDB or MySQL server, and the Amazon Relational Database™ Service (RDS).

Warning:

If both of the following conditions are true, you may introduce a security vulnerability:

  • The local server runs MySQL 5.7.
  • The remote server runs MySQL 8.0 and later or Amazon RDS.

This will copy a profile for the root MySQL user to the remote server with the % host. This will allow the root MySQL user to connect from any IP address. Either of the following solutions will resolve the problem:

  • Upgrade the local cPanel & WHM server to MySQL 8.0.
  • Add a root user to the remote server that is only allowed to log in from the local server’s IP address.

If the remote server runs MySQL 8.0 installed from the community repository and you have authentication issues, read our Troubleshoot MySQL® Profiles documentation.

Feature requirements

This feature only allows active connections to servers that run the following database versions:

  • MySQL versions 5.6, 5.7, and 8.0.
  • MariaDB® versions 10.1, 10.2, 10.3, 10.5, and 10.6.

For more information about which database versions we support for your operating system, read our Supported MySQL/MariaDB Versions documentation.

Additionally, a /root/.my.cnf file must exist on any remote MySQL or MariaDB servers, and this file must contain the MySQL or MariaDB root user and password.

Amazon RDS servers

You can use MySQL versions 5.7 or 8.0 on Amazon RDS servers. We do not support MariaDB or Amazon Aurora (Aurora) on Amazon RDS servers.

Amazon RDS uses the plaintext MySQL protocol. For security and performance reasons, we strongly recommend that only you connect to an Amazon RDS from an EC2™ instance in the same availability zone.

When you suspend a cPanel account, the system will not suspend any of the account’s Amazon RDS remote databases.

Remote database server information

When you create a new MySQL database in cPanel & WHM, your server will use the current active MySQL profile to determine its connection information. For example, if you activate a profile named user that connects to host example.com, you will create new MySQL databases on the host example.com server.

This feature does not automatically transfer your MySQL databases or data if you change remote servers. For example, if you create an example database with the active user profile, the example database will only exist on the host example.com server. If you then activate a profile named user2 that connects to the host not.example.com server, the example database will not automatically transfer or copy itself to the not.example.com server.

To connect an existing database to new servers, you must copy it manually and update your target server’s configuration files. For example, if you move an existing WordPress® database to a remote server, you must first copy the database to the remote server manually, then update the WordPress database server’s configuration files to use the new remote server.

Warning:
  • We strongly recommend that you only connect one cPanel & WHM server to each remote database server. If you connect multiple cPanel & WHM servers to one remote database server, you may experience database and username conflicts.
  • This feature does not automatically transfer your database data.
  • Do not use the skip-name-resolve option in your server’s database configuration. This option can cause problems on any server. It will create more problems on remote servers, during account transfers and restorations, and with phpMyAdmin.

MySQL profile information

The interface displays the following columns for each database profile:

  • Profile — The name of the database profile.

  • Host — The database server’s IP address or hostname.

  • Port — The database server’s port number.

  • User — The SSH or database username that you will use to authenticate to this host.

  • Type — A description of the profile data.

  • Actions — Click one of the following icons to perform the appropriate action:

    • Validate — Test the profile’s database server settings.
    • Activate — Set this profile as the active profile. A green lightning bolt icon () indicates the currently-active profile.
      Note:
      You may only select one active profile at a time.
    • Delete — Delete the profile.
      Note:
      You cannot delete the active profile.
    • — Edit the profile.

Add profile

Note:
If no active profile exists, the system uses the information in the /root/.my.cnf file to generate an active profile.

To create a new database profile, perform the following steps:

  1. Click Add Profile. A new interface will appear.

  2. Enter the desired database profile name in the Profile Name text box.

    Note:
    After you save the profile name, you cannot change it.

  3. Select a method to use to configure the new profile:

    • Automatically create a database superuser via SSH — Select this method to create the new profile manually.
    • Manually enter an existing database superuser’s credentials — Select this method to manually enter the new profile’s information.
      Important:
      • You must select this option if you use Amazon RDS.

      • To create a MySQL superuser, make certain that the user possesses the following privileges:

        SELECT
        ALTER
        ALTER ROUTINE
        CREATE
        CREATE ROUTINE
        CREATE TEMPORARY TABLES
        CREATE USER
        CREATE VIEW
        DELETE
        DROP
        EXECUTE
        EVENT
        INDEX
        INSERT
        REFERENCES
        RELOAD
        UPDATE
        SHOW DATABASES
        SHOW VIEW
        TRIGGER
        LOCK TABLES

      • Amazon RDS does not allow you to grant the Super privilege to users.

      Note:
      If you use Amazon RDS, enter the username and password that you configured when you deployed your Amazon RDS instance.
  4. Enter the appropriate information for the configuration method that you selected.

  • Automatically create a MySQL superuser via SSH

    • Host — The database server’s IP address or hostname.
      Warning:
      You can enter a public or private IP address. However, make certain that the database server can resolve the cPanel & WHM server’s IP address to its fully-qualified hostname.
    • SSH Port — The SSH service’s port number. You must enter a port number between 1 and 65535.
      Note:
      If the server resides behind a firewall, you will need to configure the firewall to allow traffic through the port that you select. For more information, read our How to Configure Your Firewall for cPanel & WHM Services documentation.
    • Username — The username for the SSH connection.
    • Authentication Method — Select the desired authentication method.
    • Password — Use a password to authenticate. Enter your SSH password in the Password text box.
    • SSH Key — Use an SSH key to authenticate. Enter your SSH key’s name in the SSH Key text box.
    • Password — The password for the SSH connection.
      Note:
      This setting only appears when you select the Password for the Authentication Method setting.
    • SSH Key — The name of the SSH key to use to log in to the remote server.
      Note:
      • This setting only appears when you select the SSH Key for the Authentication Method setting.
      • Use WHM’s Manage Root’s SSH Keys interface (WHM » Home » Security » Manage Root’s SSH Keys) to add SSH keys.
      • A /root/.my.cnf file must exist on any remote MySQL servers, and this file must contain the MySQL root user and password.
  • Manually enter an existing MySQL superuser’s credentials

    • Host — The database server’s IP address or hostname.
      Warning:
      You can enter a public or private IP address. However, make certain that the database server can resolve the cPanel & WHM server’s IP address to its fully-qualified hostname.
    • Port — The database server’s port number. You must enter a port number between 1 and 65535.
      Note:
      If the server resides behind a firewall, you will need to configure the firewall to allow traffic through the port that you select. For more information, read our How to Configure Your Firewall for cPanel & WHM Services documentation.
    • Username — The database superuser’s username.
    • Password — The database superuser’s password.
  1. Click Save.
Remember:

For more information, read our Troubleshoot MySQL® Profiles documentation.

Edit profile

To edit a database profile, perform the following steps:

  1. Click the arrow icon next to the profile you wish to edit. A new interface will appear.

    Note:
    You cannot change the profile’s name. If you wish to use a different profile name for a connection, you must delete and recreate the profile with a new name.

  2. If you wish to change the hostname, enter the new database server’s IP address or hostname in the Host text box.

    Warning:
    You can enter a public or private IP address. However, make certain that the database server can resolve the cPanel & WHM server’s IP address to its fully-qualified hostname.

  3. If you wish to change the port number, enter the new port number in the Port text box.

    Note:
    If the server resides behind a firewall, you will need to configure the firewall to allow traffic through the port that you select. For more information, read our How to Configure Your Firewall for cPanel & WHM Services documentation.

  4. If you wish to change the database superuser’s username for the connection, enter the new username in the Username text box.

  5. If you wish to change the database superuser’s password for the connection, enter the new password in the Password text box.

  6. Click Save to save your changes, or click Cancel to cancel the changes.

Additional Documentation