Welcome Guest, Not a member yet? Register   Sign In
NOT Able to connect to database ?
#1

[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
#2

[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.
#3

[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 !!




Theme © iAndrew 2016 - Forum software by © MyBB