如何修改Discuz数据库配置?

当您的数据库信息发生变化的时候,Discuz网站系统需要修改的位置三处:


1、路径:/wwwroot/config/config_global.php,修改如下的代码片段


// —————————-  CONFIG DB  —————————– //

$_config['db']['1']['dbhost'] = 'localhost';

$_config['db']['1']['dbuser'] = 'dbname';

$_config['db']['1']['dbpw'] = 'password;

$_config['db']['1']['dbcharset'] = 'utf8';

$_config['db']['1']['pconnect'] = '0';

$_config['db']['1']['dbname'] = 'discuz';

$_config['db']['1']['tablepre'] = 'websoft9_';

$_config['db']['slave'] = '';

$_config['db']['common']['slave_except_table'] = '';

2、路径:/wwwroot/config/config_ucenter.php,修改如下的代码段


define('UC_CONNECT', 'mysql');

define('UC_DBHOST', 'localhost');

define('UC_DBUSER', 'dbusername');

define('UC_DBPW', 'password');

define('UC_DBNAME', 'dbname');

define('UC_DBCHARSET', 'utf8');

3、路径:/wwwroot/uc_server/data/config.inc.php,修改如下的代码段


define('UC_DBHOST', 'localhost');

define('UC_DBUSER', 'username');

define('UC_DBPW', 'password');

define('UC_DBNAME', 'dbname');