Updating Database Credentials for CMS

Browse by products and services

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.

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.

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:

Log in to phpMyAdmin. You will see a list of available databases on the left side that the database user has access to.

Select a WordPress database and then identify the _wpoptions table.

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)