用户
 找回密码
 入住 CI 中国社区
搜索
查看: 3219|回复: 4
收起左侧

[HELP] 数据库连接问题

[复制链接]
发表于 2011-9-13 15:00:49 | 显示全部楼层 |阅读模式
配置文件中的链接设置:
PHP复制代码
$db['default']['hostname'] = 'localhost';
$db['default']['username'] = 'root';
$db['default']['password'] = 'root';
$db['default']['database'] = 'godbit_pagination_tut';
$db['default']['dbdriver'] = 'mysql';
$db['default']['dbprefix'] = '';
$db['default']['pconnect'] = TRUE;
$db['default']['db_debug'] = TRUE;
$db['default']['cache_on'] = FALSE;
$db['default']['cachedir'] = '';
$db['default']['char_set'] = 'utf8';
$db['default']['dbcollat'] = 'utf8_general_ci';
$db['default']['swap_pre'] = '';
$db['default']['autoinit'] = TRUE;
$db['default']['stricton'] = FALSE;
复制代码

并且控制器中已经加载$this->load->database();了,怎么出现链接错误
A Database Error Occurred
Unable to connect to your database server using the provided settings.

Filename: D:\Program Files\Apache Software Foundation\Apache2.2\htdocs\CI\system\database\DB_driver.php

Line Number: 124
求哪位大虾帮小弟看下,不胜感激
发表于 2011-9-13 15:04:49 | 显示全部楼层
A Database Error Occurred
Unable to connect to your database server using the provided settings.

根据你提供的配置,无法连接到数据库。

检查下密码啥的吧
发表于 2011-9-14 18:48:57 | 显示全部楼层
用命令行连一下数据库看能连上不,要不用phpmyadmin连。

说不定你的数据库没启动
发表于 2012-6-20 10:28:06 | 显示全部楼层
LZ问题解决了没,偶也遇到同样的问题了
发表于 2013-7-29 14:04:05 | 显示全部楼层
请问楼主的问题,后来怎么解决的啊,我现在也碰到也同样的问题,请解答,谢谢

本版积分规则