我正在使用Codeigniter,我无法连接我的数据库,给我一个错误:
我只是在autoload.php中添加库:
`$autoload['libraries'] = array('database');`
这是我在database.php中的设置
$active_group = 'default';
$query_builder = TRUE;
$db['default'] = array(
'dsn' => '',
'hostname' => 'localhost',
'username' => 'root',
'password' => 'root',
'database' => 'heroes',
'dbdriver' => 'mysqli',
'dbprefix' => '',
'pconnect' => FALSE,
'db_debug' => (ENVIRONMENT !== 'production'),
'cache_on' => FALSE,
'cachedir' => '',
'char_set' => 'utf8',
'dbcollat' => 'utf8_general_ci',
'swap_pre' => '',
'encrypt' => FALSE,
'compress' => FALSE,
'stricton' => FALSE,
'failover' => array(),
'save_queries' => TRUE
);
:有什么帮助吗?
答案 0 :(得分:1)
我刚刚通过127.0.0.1:3306