CodeIgniter Forums
NOT Able to connect to database ? - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20)
+--- Forum: Archived General Discussion (https://forum.codeigniter.com/forumdisplay.php?fid=21)
+--- Thread: NOT Able to connect to database ? (/showthread.php?tid=7553)



NOT Able to connect to database ? - El Forum - 04-14-2008

[eluser]Unknown[/eluser]
Hi
i am not able to connect to the database through the codeigniter.

This is my database.php file configuration. And its right.

$active_group = "default";
$active_record = TRUE;

$db['default']['hostname'] = "localhost";
$db['default']['username'] = "root";
$db['default']['password'] = "";
$db['default']['database'] = "codetest";
$db['default']['dbdriver'] = "mysql";
$db['default']['dbprefix'] = "";
$db['default']['pconnect'] = TRUE;
$db['default']['db_debug'] = FALSE;
$db['default']['cache_on'] = FALSE;
$db['default']['cachedir'] = "";
$db['default']['char_set'] = "utf8";
$db['default']['dbcollat'] = "utf8_general_ci";


But still I am not able to connect with database.
Please help me to resolve this issue


NOT Able to connect to database ? - El Forum - 04-14-2008

[eluser]Razz[/eluser]
are you running CI on the same machine as your mysql database? or are you running CI and mysql on two separate machines....

if all the information is correct like you said, then you have me stumped.


NOT Able to connect to database ? - El Forum - 04-14-2008

[eluser]Unknown[/eluser]
No I am using a single machine. but thanks I resolved the problem its due to the autoload.php , I have to set a variable their i.e
$autoload['libraries'] = array('database');

Thanks buddy !!