MySQL Database

ID #389

How do I update my web application to connect to a different database server?

Applies to: Grid System

To change the database server that your web application currently connects to, you will need to update the application's configuration file with the new database server name.

As an example, if you have migrated your database from 'db.modwest.com' to 'db2.modwest.com', your application's configuration file will need be configured as well, to connect to 'db2.modwest.com', as this is where the new database resides.

So, for instance, if your Wordpress wp-config.php file reads like this:

('DB_NAME', 'database_name');
('DB_USER', 'database_user');
('DB_PASSWORD', 'database_password');
('DB_HOST', 'db.modwest.com');



the configuration file will need to be updated, if your database has been migrated to the 'db2.modwest.com' database server, as follows:

('DB_NAME', 'new_database_name');
('DB_USER', 'database_user');
('DB_PASSWORD', 'database_password');
('DB_HOST', 'db2.modwest.com');



Below are the names of the configuration files for a few common applications, all of which are found in the application's main folder:

Joomla: configuration.php

Drupal: settings.php

Wordpress: wp-config.php

Mediawiki: LocalSettings.php

X-Cart: config.php

Moodle: config.php




Last update: 2010-10-05 16:18
Author: FAQ Admin
Revision: 1.2

Digg it! Share on Facebook Print this record Send FAQ to a friend Show this as PDF file
Please rate this FAQ:

Average rating: 3 (2 Votes)

completely useless 1 2 3 4 5 most valuable

You can comment this FAQ