Updating Database Credentials for CMS


Browse by products and services

  • Applies to: Grid
    • Difficulty: Medium
    • Time Needed: 20
    • Tools Required: AccountCenter access or SSH access

Overview

This article shows you how to update database connection information for various types of Content Management Systems (CMS) on your Grid server.

You may need to do this for a variety of reasons that include:

  • Updating a database password to meet security requirements. This may be required after a PHP version change. If this is the case, it will usually trigger a database connection error when attempting to access the site. 
  • Fixing a database connection error. These errors will usually return a message in the browser when attempting to access the site. Very often, simply updating your database connection credentials will fix these issues.
    • WordPress: "Error Establishing Database Connection"
    • Drupal/Joomla: "The website encountered an unexpected error. Please try again later".
      

Instructions 

These instructions explain how to update your database credentials for WordPress, Drupal, and Joomla. There are many other types of CMS that are not covered here. A list of configuration files for other CMS is provided at the bottom of the article.

Are you experiencing an "Error establishing a database connection" on your WordPress site? Consider using these instructions: How do I fix an Error Establishing Database Connection?

Verify database user settings

Begin by verifying that you have the correct database password and user. If a database user does not have access to a given database the site uses, the site will not be able to connect. Verify your user and password info by using your access domain to log into phpMyAdmin. Use the database manager utility in the account center to create or modify users, permissions, and passwords. 

WordPress

1. Log into the Account Center and navigate to the Grid file manager. Navigate to your WordPress site's wp-config.php file and click the edit button on the right side of the menu. If you prefer, you may also access this information via an SSH connection and edit using a text editor. 

 2. Identify the database connection information. Be sure to copy the contents of this file to a notepad or similar utility before editing.

 

 Verify or update the settings as needed:

  • Database name: This is the name of the database that WordPress connects to. For 1-click installs, this is automatically configured and should be correct unless you have made changes. If you are unsure of what the proper database name is, do the following:
  1. Log in to phpMyAdmin. You will see a list of available databases on the left side that the database user has access to. 
  2. Select a WordPress database and then identify the _wpoptions table.
  3. Click on the _wpoptions table to list its contents using the Browse tab. This table should include the site URL and home. If this value matches the address of your WordPress site, this is likely the proper database.  
  • Database Username: The database username may be set properly in wp-config.php, but the assigned user does not have permission to access the database. Make sure that the database username is set to a user that has permission to access to the database. This is more likely to be an issue if you have recently migrated a WordPress site from a different location and did not create the database user or give the user proper permissions.
  • Database Password: If you are unsure of the database password, reset the database user's password using the database user management tool in the account center, and then use that new value for the database password field.
  • Database Hostname: The database hostname is the address of the database server. Unless you are connecting to an external database, the database hostname should be set to 'internal-db.s00000.gridserver.com'. Replace this information with the information found in your server guide

 3. Verify that the permissions are set properly and click save. Your database credentials should now be updated to the proper settings. If you are unable to see your site, try clearing your cache.

Drupal

1. Log into the Account Center and navigate to the Grid file manager. Navigate to your Drupal site's settings.php file and click the edit button on the right side of the menu. If you prefer, you may also access this information via an SSH connection and edit using a text editor. 

 

 2. Identify the database connection information. Be sure to copy the contents of this file to a notepad or similar utility before editing. Keep in mind that there are many different database configurations for Drupal, and that some of these instructions may not apply to your setup. 

Verify or update the settings as needed:

  • Database: This is the name of the database that Drupal connects to. For 1-click installs, this is automatically configured and should be correct unless you have made changes.
  • Username: The database username may be set properly in settings.php, but the assigned user does not have permission to access the database. Make sure that the database username is set to a user that has permission to access to the database. This is more likely to be an issue if you have recently migrated a Drupal site from a different location and did not create the database user or give the user proper permissions.
  • Database Password: If you are unsure of the database password, reset the database user's password using the database user management tool in the account center, and then use that new value for the database password field.
  • Prefix: This is the prefix applied to each of your database tables. It allows for multiple sites or applications to share the same database, as long as they each have different prefixes. In most cases, this will remain set as the default, 'drup_' ,
  • Host: The database host is the address of the database server. Unless you are connecting to an external database, the database hostname should be set to 'internal-db.s00000.gridserver.com'. Replace this information with the information found in your server guide
  • Port: This is 3306 by default and should not change. 
  • Namespace: Your install may not include this field. If it does, make sure it is set to 'Drupal\\Core\\Database\\Driver\\mysql',
  • Driver: This should always be set to 'mysql',.

3.Verify that the permissions are set properly and click save. Your database credentials should now be updated to the proper settings. If you are unable to see your site, try clearing your cache

Joomla

1. Log into the Account Center and navigate to the Grid file manager. Navigate to your Joomla site's configuration.php file and click the edit button on the right side of the menu. If you prefer, you may also access this information via an SSH connection and edit using a text editor. 

2. Identify the database connection information. Be sure to copy the contents of this file to a notepad or similar utility before editing. 

 

Verify or update the settings as needed:

  • Dbtype: This should be set to 'mysqli';.
  • Host: The database host is the address of the database server. Unless you are connecting to an external database, the database hostname should be set to 'internal-db.s00000.gridserver.com'. Replace this information with the information found in your server guide
  • User: The database username may be set properly in configuration.php, but the assigned user does not have permission to access the database. Make sure that the database username is set to a user that has permission to access to the database. This is more likely to be an issue if you have recently migrated a Joomla site from a different location and did not create the database user or give the user proper permissions.
  • Password: If you are unsure of the database password, reset the database user's password using the database user management tool in the account center, and then use that new value for the database password field.
  • Db: This is the name of the database that Joomla connects to. For 1-click installs, this is automatically configured and should be correct unless you have made changes.
  • Dbprefix: This is the prefix applied to each of your database tables. It allows for multiple sites or applications to share the same database, as long as they each have different prefixes. In most cases, this will remain set as the default, 'drup_' ,

3. Verify that the permissions are set properly and click save. Your database credentials should now be updated to the proper settings. If you are unable to see your site, try clearing your cache

Other CMS configuration file locations 

Each of these configuration files should be somewhat similar to those listed in this article. If you're not sure how to update them, use the relevant CMS official documentation. (Scrollable text box)

4Images Gallery /config.php
B2 Evolution /conf/_basic_config.php
Boonex Dolphin /inc/header.inc.php
Concrete5 /config/site.php
Coppermine Photo Gallery /include/config.inc.php
Crafty Syntax Live Help /config.php
Cube Cart /includes/global.inc.php
dotProject /includes/config.php
e107 /e107_config.php
ExpressionEngine /system/USER/config/database.php
FAQMasterFlex /faq_config.php
Gallery /config.php
Geeklog /db-config.php or /siteconfig.php or /lib-common.php
glfusion /private/db-config.php
Hotaru /hotaru_settings.php
LiveSite /livesite/config.php
LifeType /config/config.properties.php
Magento /app/etc/local.xml
Mambo /configuration.php
Marketecture /include/config.php
MODx /manager/includes/config.inc.php
Moodle /config.php
MyBB /inc/config.php
Noahs Classifieds /app/config.php
Nucleus /config.php
ocPortal /info.php
OpenCart /config.php or /admin/config.php
osCommerce /includes/configure.php or /admin/includes/configure.php
Oxwall /ow_includes/config.php
PHP-Nuke /config.php
phpBB /config.php
phpFormGenerator /index.php or /mysql.class.php
phpFreeChat /forms/admin/config.inc.php
PHPlist /config/config.php
phpMyDirectory /defaults.php
phpWCMS /include/inc_conf/conf.inc.php
phpWebSite /conf/config.php
PhpWiki /admin.php or /lib/config.php
Pligg /libs/dbconnect.php
Post-Nuke /config.php
PrestaShop /config/settings.inc.php
Saurus CMS /config.php
ShopSite /includes/configure.php or /admin/includes/configure.php
Siteframe /config.php
Simple Machines Forum /Settings.php
Soholaunch /sohoadmin/config/isp.conf.php
SugarCRM /config.php
Textpattern /textpattern/config.php
TikiWiki /db/local.php
Tomato Cart /includes/configure.php
Trendy Site Builder (does not use DB)
TYPO3 /typo3conf/localconf.php
vBulletin /includes/config.php
WebCalendar /includes/settings.php
WHMCS /configuration.php
X7 Chat /config.php
Xoops /mainfile.php
Zen Cart /includes/configure.php or /admin/includes/configure.php
Zen Photo zp-data/zenphoto.cfg
Zikula /config.php

Resources

How do I fix an Error Establishing Database Connection?
Managing Database Users on the Grid
Using the Grid File Manager