我已经搜索了很多,但是没有找到结果。 This就像我面临的同样问题,但我尝试了所有问题,但没有解决方案。
当我通过Filezilla将代码从本地上传到服务器时,它给我一个错误。在本地它工作正常。我还仔细检查了主机名,用户名,密码,数据库,它们都是正确的。但它仍然给出:
Unable to connect to your database server using the provided settings.
Filename: core/CodeIgniter.php
Line Number: 518
我的配置
$db['default'] = array(
'dsn' => '',
'hostname' => 'http://abcdef.net',// i have try localhost, abcdef.net/admindb
'username' => 'XXXX',
'password' => 'XXX',
'database' => 'XXXX',
'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
);
/system/core/codeIgniter.php中的第518行看起来像这样
$CI = new $class();