If you have changed the database access password via the hosting control panel, the site using the database may stop working. To restore the site’s operation, you must specify the new password in the site’s configuration files.
Below is a list of configuration files and the lines containing the database connection settings for popular CMS platforms. The paths are given assuming the CMS is installed in the default root directory (~/your_domain/docs/).
1. Joomla!
2. WordPress
3. 1C-Bitrix
4. Drupal
5. PHPShop
6. UMI.CMS
7. MODX Revolution
8. OpenCart
9. Webasyst
10. Datalife Engine (DLE)
11. Other CMS
The file in which the connection parameters are specified:
~/your_domain/docs/configuration.php
Lines:
var $host = 'server_name';
var $user = 'username';
var $db = 'database_name';
var $password = 'password';
The file in which the connection parameters are specified:
~/your_domain/docs/wp-config.php
Lines:
define('DB_NAME', 'database_name');
define('DB_USER', 'username');
define('DB_HOST', 'server_name');
define('DB_PASSWORD', 'password');
The file in which the connection parameters are specified:
~/your_domain/docs/bitrix/php_interface/dbconn.php
Lines:
$DBHost = "server_name";
$DBLogin = "username";
$DBPassword = "password";
$DBName = "database_name";
From version 14 onwards, the connection parameters are also in:
~/your_domain/docs/bitrix/.settings.
Lines:
'host' => 'server_name',
'database' => 'database_name',
'login' => 'username',
'password' => 'password',
The file in which the connection parameters are specified:
~/your_domain/docs/sites/default/settings.php
Line:
$db_url = 'mysql://username:password@server_name/database_name';
The file in which the connection parameters are specified:
~/your_domain/docs/phpshop/inc/config.ini
Lines:
host = "server_name";
user_db = "username";
pass_db = "password";
dbase = "database_name";
Since version 2.8.x, database connection parameters are stored in:
~/your_domain/docs/config.ini
Lines:
ore.host = "server_name”
core.login = "username”
core.password = "password”
core.dbname = "database_name”
By default, the database connection parameters are in:
~/your_domain/docs/core/config/config.inc.php
Lines:
$database_server = 'server_name';
$database_user = 'username';
$database_password = 'password';
$dbase = 'database_name';
$database_dsn = 'mysql:host=server_name;dbname=database_name';
Database connection parameters are specified in two files:
~/your_domain/docs/config.php/p>
~/your_domain/docs/admin/config.php~/your_domain/docs/wp-config.php
Lines:
define('DB_HOSTNAME', 'server_name');
define('DB_USERNAME', 'username');
define('DB_PASSWORD', 'password');
define('DB_DATABASE', 'database_name');
The file in which the connection parameters are specified:
~/your_domain/docs/wa-config/db.php
Lines:
'host' => 'server_name',
'port' => false,
'user' => 'username',
'password' => 'password',
'database' => 'database_name',
'type' => 'mysql',
The file in which the connection parameters are specified:
~/your_domain/docs/engine/data/dbconfig.php
Lines:
define ("DBHOST", "server_name");
define ("DBNAME", "database_name");
define ("DBUSER", "username");
define ("DBPASS", "password");
If your CMS is not listed here, check the CMS documentation or contact the site developer for information about its configuration files. In most cases, you can also find the configuration files by connecting to the hosting server via SSH and running:
grep -R -l "login.mysql" your_domain/docs
This will output a list of files containing the database server name login.mysql. Most often, the other parameters (username, password, database name) are in the same file as the server name.