Can a Reseller Set Up a Database on One cPanel and Allow the Other cPanels to Connect to That Database?

If the Database is on the Same Server

As long as the database is on the same server, you only need to configure the other cPanels to connect locally to the database with a valid database username and password. The host name will be "localhost."

The following configuration settings are required for a local database connection:

  • Host name - localhost
  • Database name- cPanelUsername_DatabaseName
  • Database username - cPanelUsername_DatabaseUsername
  • Database password - whatever you selected
Please be sure to replace "cPanelUsername," "DatabaseName," "DatabaseUsername" with your actual cPanel username, database name and username.

For more information on connecting a script to your database, please read:

If the Database is on a Different Server

If the database you want is on a different server, then you need to make a remote connection. All the configuration settings will be the same as above, except you will need to use the database server's IP address in place of "localhost."

The following configuration settings are required for a local database connection:

  • Host name - the database's server IP
  • Database name - cpanelUsername_DatabaseName
  • Database username - cpanelUsername_databaseUsername
  • Database password - whatever you selected
Please note that prior to creating a remote connection to any SQL database, you need to have the connecting IP whitelisted in order for it to function. For more information about arranging a remote connection to a database or whitelisting your IP, please read:

cPanelcPanel is a popular web hosting control panel that helps you manage your hosting account and assists you in creating web sites, managing e-mail addresses, & installing applications to a server.

cPanel is available on all HostGator Linux hosting plans, including Shared Hosting, Reseller Hosting, VPS and Linux Dedicated Servers.