What to do after the cPanel account's username change

Changing the username of a cPanel account has certain consequences. This article covers what you’ll need to keep in mind after requesting this change within our Shared Hosting servers.

As an example, we will reference screenshots of a cPanel account with the following setup:
  • Existing cPanel username: cpuser1
  • New cPanel username: cpuser2
  • MySQL Databases (and their privileged MySQL User): cpuser1_db1 (cpuser1_dbuser1), cpuser1_db2 (cpuser1_dbuser2), cpuser1_db3 (cpuser1_dbuser3)
  • PostgreSQL Databases (and their privileged PostgreSQL User): cpuser1_pdb1 (cpuser1_pdbuser1), cpuser1_pdb2 (cpuser1_pdbuser2), cpuser1_pdb3 (cpuser1_pdbuser3)
  • Primary (default) cPanel Email Account: cpuser1@server.hostname
  • Primary (default) cPanel FTP Account username: cpuser1
  • Primary (default) cPanel Web Disk Account: cpuser1
In this case, the username of the cPanel account is changed from cpuser1 to cpuser2. The post-change changes to your setup are as follows:

1. Home Directory
2. MySQL databases and MySQL users
3. PostgreSQL databases and PostgreSQL users
4. Website configuration scripts
5. Primary (default) cPanel FTP account
6. Primary (default) cPanel Email account
7. Primary (default) cPanel Web Disk account



Changing the username of a cPanel account affects the path to the Home Directory. This is important because some scripts rely on absolute paths (those starting from the root, “/”) e.g. /home/cpuser1/public_html/.


But if your website script incorporates paths related to the current working directory (called relative paths), you won’t need to make any changes.


All MySQL databases and database usernames created in cPanel are associated with the cPanel username. They are formatted as: cPanelUsername_DatabaseName for databases (e.g. cpuser1_db1), or cPanelUsername_DatabaseUser (e.g. cpuser1_dbuser1) for database users.

When the cPanel username is changed, the database names and usernames are updated automatically too. However, the update is applied within the server configuration files only. That means if you have an active connection set up on one of the hosted MySQL databases (e.g., Workbench or Navicat MySQL client), the connection and its settings need to be changed. Otherwise, MySQL client software may not work as expected.

We suggest keeping the new cPanel username the same length or shorter. A longer name may cause MySQL service to truncate the account’s database names and database usernames, which may cause unexpected problems in the future.


Similar to MySQL databases, PostgreSQL databases have similar layouts for their database names and users: cPanelUsername_DatabaseName and cPanelUsername_DatabaseUser. So you’ll also need to change the connections to the PostgreSQL server.

PostgreSQL users may not be able to log in until their passwords are reset using the cPanel PostgreSQL Databases >> Current Users >> Change Password menu. The Grants will also need to be synchronized after the cPanel username change is applied:


If you get the error message “Login to PostgreSQL failed” while attempting to reach the interface of the cPanel >> phpPgAdmin menu, resetting the cPanel account’s password should resolve it.


4. Website configuration scripts


Because of changes to the naming of the Home Directory and database access credentials (as mentioned in sections 1 to 3), certain website scripts may stop working as expected and display random error messages.

Please note that the cPanel username is changed on the hosting server only. Website-specific files and directories remain unaffected.

If your website depends on the MySQL-based databases or other connections, configuration files will need to be updated to align with the applied cPanel username change. For instance, a website based on the WordPress Content Management System (CMS) will keep displaying the “Error Establishing A Database Connection” message unless its wp-config.php file is edited to match the new cPanel configuration.

NOTE: Each CMS has its own location for configuration files. The following list of popular CMS platforms provides their locations. Ensure the configuration files match the database connection setup. If the CMS or framework of your website is not listed below, contact your site platform provider or refer to the software specifications.


Content Management System (CMS)
Default location of the configuration file
AbanteCart
/system/config.php
Concrete5
/application/config/database.php
CubeCart
/includes/global.inc.php
Dolphin
/inc/header.inc.php
Drupal
/sites/default/settings.php
Joomla
/configuration.php
Magento 1.x
/app/etc/local.xml
Magento 2.x
/app/etc/env.php
myBB
/inc/config.php
OpenCart
/admin/config.php and /config.php
phpBB
/config.php
PrestaShop
/config/settings.inc.php
SMF
/Settings.php
WHMCS
/configuration.php



cPanel username always matches the primary FTP account of the hosting account. The latter provides access to the whole file system of cPanel. We strongly recommend using it, along with the SFTP (SSH-based secure FTP, encrypted) type of connection.

However, the change of the cPanel username will require updating the settings of FTP clients, such as FileZilla, Cyberduck, Dreamweaver, CoreFTP, iWeb, Adobe Muse, CuteFTP, etc.


The default cPanel email account (cPanelUsername@server.hostname) catches all unrouted email. It cannot be deleted and has no quota. Its username and password will always be the same as your cPanel account’s login.

If there are any outgoing email scripts set up using the PHP mail() function, or no custom email address set up has been specified for cron jobs, you may receive notifications to cpuser2@server.hostname after the cPanel username is changed from cpuser1 to cpuser2.


The purpose of the Web Disk utility and its accounts is to manage and manipulate files within the Home Directory of your hosting account, on multiple types of devices (such as your computer, mobile device, or certain types of software).

This interface allows you to manage the file system using the Web Distributed Authoring and Versioning (WebDAV) protocol. The username of the main Web Disk account always corresponds to that of the cPanel account.

This WebDisk account can access all of the files in your Home Directory. So if you use WebDav protocol to manage the files of the hosting account through the main Web Disk account, make sure to update the connection’s configuration after the cPanel username is changed.

Updated
Viewed
10382 times

Need help? We're always here for you.

notmyip