薛伟 发表于 2011-9-13 15:00:49

数据库连接问题

配置文件中的链接设置:$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
求哪位大虾帮小弟看下,不胜感激

jeongee 发表于 2011-9-13 15:04:49

A Database Error Occurred
Unable to connect to your database server using the provided settings.

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

检查下密码啥的吧

baiyuxiong 发表于 2011-9-14 18:48:57

用命令行连一下数据库看能连上不,要不用phpmyadmin连。

说不定你的数据库没启动

月下之风 发表于 2012-6-20 10:28:06

LZ问题解决了没,偶也遇到同样的问题了

我是不是新手 发表于 2013-7-29 14:04:05

请问楼主的问题,后来怎么解决的啊,我现在也碰到也同样的问题,请解答,谢谢
页: [1]
查看完整版本: 数据库连接问题