Database Connection Strings


I wanted to post this to help others who have run into trouble with the message along the lines of “Cannot Establish Database Connection”.   This can happen for several reasons but usually the fix is fairly easy – you just need to modify a single file in your WordPress or Drupal or other file system according to the instructions below using FTP access.

If you move servers or rename the database or change your password you’ll want to go in and carefully put in the new database name or password.

If you’ve forgotten either of those, you may need to dig in to your control panel to find them.    Ask your web host how to do that part as it depends on many things, but the part below is usually simple and done via FTP to your server.

Source:  Godaddy

Connection strings for website databases:

NOTE:You will have to obtain these files referenced below by FTPing into your hosting account and into the application’s directories. For more information on this, see your application’s manufacturer’s Web site.

WordPress

Edit the wp-config.php file. You will need to update the following line with the name of the new database server.

define(‘DB_HOST’, ‘youroldhostname’);

Joomla

Edit the configuration.php file. You will need to update the following line with the name of the new database server.

var $host = ‘youroldhostname’;

Simple Machine Forum

Edit the Settings.php file. You will need to update the following line with the name of the new database server.

$db_server = ‘youroldhostname’;

DotNetNuke

Edit the web.config file. You will need to update the following line with the name of the new database server.

connectionString=”Server=youroldhostname;Database=DBName;uid=DBUser;pwd=DBPass;”

Drupal

Edit the sites/default/settings.php file. You will need to update the following line with the name of the new database server.

$db_url = ‘mysqli://DBUser:DBPassword@youroldhostname/DBName’;

Zen Cart

Edit the includes/configure.php and admin/includes/configure.php files. You will need to update the following line with the name of the new database server.

define(‘DB_SERVER’, ‘youroldhostname’);

Gallery

Edit the config.php file. You will need to update the following line with the name of the new database server.

$storeConfig[‘hostname’] = ‘youroldhostname’;

Coppermine

Edit the include/config.inc.php file. You will need to update the following line with the name of the new database server.

$CONFIG[‘dbserver’] = ‘youroldhostname’;

OSCommerce

Edit the includes/configure.php and admin/includes/configure.php files. You will need to update the following line with the name of the new database server.

define(‘DB_SERVER’, ‘youroldhostname’);

PhpBB

Edit the config.php file. You will need to update the following line with the name of the new database server.

$dbhost = ‘youroldhostname’;

Vanilla Forum

Edit the conf/database.php file. You will need to update the following line with the name of the new database server.

$Configuration[‘DATABASE_HOST’] = ‘youroldhostname’;

paFileDB

Edit the includes/config.php file. You will need to update the following line with the name of the new database server.

$dbServer = “youroldhostname”;

Noah’s Classifieds

Edit the app/config.php file. You will need to update the following line with the name of the new database server.

$hostName=”youroldhostname”;

OpenX

Edit the var/yoursitename.com.conf.php file. You will need to update the following line with the name of the new database server.

host=”youroldhostname”

BlogEngine.NET

Edit the web.config file. You will need to update the following line with the name of the new database server.

<add name=”BlogEngine” connectionString=”Data Source=youroldhostname;User ID=DBUser;Password=DBPassword;persist security info=False;initial catalog=DBName;” providerName=”System.Data.SqlClient”/>

Geeklog

Edit the db-config.php file. You will need to update the following line with the name of the new database server.

$_DB_host = ‘youroldhostname’;

Lifetype

Edit the config/config.properties.php file. You will need to update the following line with the name of the new database server.

$config[‘db_host’] = ‘youroldhostname’;

reBlog

Edit the config.php file. You will need to update the following line with the name of the new database server.

define(‘REF_DB_HOST’, “youroldhostname”);

Serendipity

Edit the serendipity_config_local.inc.php file. You will need to update the following line with the name of the new database server.

$serendipity[‘dbHost’] = ‘youroldhostname’;

Mantis

Edit the config_inc.php file. You will need to update the following line with the name of the new database server.

$g_hostname = “youroldhostname”;

MediaWiki

Edit the LocalSettings.php and config/LocalSettings.php files. You will need to update the following line with the name of the new database server. $wgDBserver = “youroldhostname”;

WebCalendar

Edit the includes/settings.php file. You will need to update the following line with the name of the new database server.

db_host: youroldhostname

anyInventory

Edit the globals.php file. You will need to update the following line with the name of the new database server.

$db_host = “youroldhostname”;

Mambo

Edit the configuration.php file. You will need to update the following line with the name of the new database server.

$mosConfig_host = ‘youroldhostname’;Community Server

Edit the connectionStrings.config file. You will need to update the following line with the name of the new database server.

<add name=”SiteSqlServer” connectionString=”server=youroldservername;uid=DBUser;pwd=’DBPassword’;database=DBName”/>

MODx

Edit the includes/config.inc.php file. You will need to update the following line with the name of the new database server.

$database_server = ‘youroldhostname’;

Moodle

Edit the config.php file. You will need to update the following line with the name of the new database server.

$CFG->dbhost = ‘youroldhostname’;

Nucleus

Edit the config.php file. You will need to update the following line with the name of the new database server.

$MYSQL_HOST = ‘youroldhostname’;

PostNuke

Edit the config.php file. You will need to update the following line with the name of the new database server.

$pnconfig[‘dbhost’] = ‘youroldhostname’;

SilverStripe

Edit the tutorial/_config.php file. You will need to update the following line with the name of the new database server.

“server” => “youroldhostname”,

Xoops

Edit the mainfile.php file. You will need to update the following line with the name of the new database server.

define( ‘XOOPS_DB_HOST’, ‘youroldhostname’ );

Pinnacle Cart

Edit the content/engine/engine_config.php file. You will need to update the following line with the name of the new database server.

define(‘DB_HOST’, ‘youroldhostname’);

BidWare

Edit the configuration/configure.inc.php file. You will need to update the following line with the name of the new database server.

$bidwareTsohbD = ‘youroldhostname’;

Elgg

Edit the engine/settings.php file. You will need to update the following line with the name of the new database server.

$CONFIG->dbhost = ‘youroldhostname’;

4Images

Edit the config.php file. You will need to update the following line with the name of the new database server.

$db_host = “youroldhostname”;

YetAnotherForum

Edit the yafnet.config file. You will need to update the following line with the name of the new database server.

<connstr>user id=DBUser;pwd=DBPassword;data source=youroldhostname;initial catalog=DBName;timeout=90</connstr>Brim

Edit the framework/configuration/databaseConfiguration.php file. You will need to update the following line with the name of the new database server.

$host = ‘youroldhostname’;

dotProject

Edit the includes/config.php file. You will need to update the following line with the name of the new database server.

$dPconfig[‘dbhost’] = ‘youroldhostname’;

OpenDB

Edit the include/local.config.php file. You will need to update the following line with the name of the new database server.

‘host’=>’youroldhostname’, //OpenDb database host

OrangeHRM

Edit the lib/confs/Conf.php file. You will need to update the following line with the name of the new database server.

$this->dbhost = ‘youroldhostname’;

phpCollab

Edit the includes/settings.php file. You will need to update the following line with the name of the new database server.

define(‘MYSERVER’, ‘youroldhostname’);

PHProjekt

Edit the config.inc.php file. You will need to update the following line with the name of the new database server.

define(‘PHPR_DB_HOST’, ‘youroldhostname’);

Aardvark Topsites

Edit the settings_sql.php file. You will need to update the following line with the name of the new database server.

$CONF[‘sql_host’] = ‘youroldhostname’;

Advanced Guestbook

Edit the admin/config.inc.php file. You will need to update the following line with the name of the new database server.

$GB_DB[“host”] = “youroldhostname”;

Advanced Poll

Edit the db/include/config.inc.php file. You will need to update the following line with the name of the new database server.

$POLLDB[“host”] = “youroldhostname”;

PHCDownload

Edit the include/config.ini.php file. You will need to update the following line with the name of the new database server.

$config[‘db_server’] = “youroldservername”;

phpMyFAQ

Edit the inc/data.php file. You will need to update the following line with the name of the new database server.

$DB[“server”] = ‘youroldhostname’;

phpmyvisites

Edit the config/config.php file. You will need to update the following line with the name of the new database server.

‘db_host’ => ‘youroldhostname’,

PHPOpenChat

Edit the config.inc.php file. You will need to update the following line with the name of the new database server.

define(‘DATABASE_HOST’, ‘youroldhostname’);

MediaWiki

Edit the LocalSettings.php file. You will need to update the following line with the name of the new database server.

$wgDBserver = “‘youroldhostname'”;