【发布时间】:2018-06-18 23:18:10
【问题描述】:
这是我的数据库配置文件:
$db['default'] = array(
'dsn' => '',
'hostname' => 'localhost:8080',
'username' => 'root',
'password' => '',
'database' => 'some_db',
'dbdriver' => 'mysqli',
'dbprefix' => '',
'pconnect' => TRUE,
'db_debug' => FALSE,
'cache_on' => FALSE,
'cachedir' => '',
'char_set' => 'utf8',
'dbcollat' => 'utf8_general_ci',
'swap_pre' => '',
'encrypt' => FALSE,
'compress' => FALSE,
'stricton' => FALSE,
'failover' => array(),
'save_queries' => TRUE
);
我的确切错误信息是这样的:
A Database Error Occurred
Unable to connect to your database server using the provided settings.
【问题讨论】:
-
尝试将 'localhost' 更改为 '127.0.0.1'。您有可以连接的 SQL 客户端吗?这是在您的开发机器上运行还是在远程系统上运行?
-
可能升级到最新版本
-
@wolfgang1983 到目前为止,这不是一个选项。
-
尝试不使用端口,例如
'hostname' => 'localhost',mysql 的典型端口是3606,但您不需要hostname中的端口。
标签: php codeigniter mysqli xampp localhost