CodeIgniter Forums
MySql database in localhost - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Archived Discussions (https://forum.codeigniter.com/forum-20.html)
+--- Forum: Archived General Discussion (https://forum.codeigniter.com/forum-21.html)
+--- Thread: MySql database in localhost (/thread-28271.html)



MySql database in localhost - El Forum - 03-06-2010

[eluser]gcanizal[/eluser]
Hi!

I am trying to connect to a databse in my localhost from CodeIgniter. I have followed manual steps and this is my configuration in database.php
Code:
$active_group = "gto_db";
$active_record = TRUE;


$db['gto_db']['hostname'] = "localhost";
$db['gto_db']['username'] = "root";
$db['gto_db']['password'] = "gu1ll3rm0";
$db['gto_db']['database'] = "gto";
$db['gto_db']['dbdriver'] = "mysql";
$db['gto_db']['dbprefix'] = "";
$db['gto_db']['pconnect'] = TRUE;
$db['gto_db']['db_debug'] = TRUE;
$db['gto_db']['cache_on'] = FALSE;
$db['gto_db']['cachedir'] = "";
$db['gto_db']['char_set'] = "utf8";
$db['gto_db']['dbcollat'] = "utf8_general_ci";
$db['gto_db']['port'] = 3306; // I have also tried without the port

If I load the database in autoload.php nothing is shown in the screen and this is what I can see in the log file:
Code:
DEBUG - 2010-03-06 19:57:41 --> Config Class Initialized
DEBUG - 2010-03-06 19:57:41 --> Hooks Class Initialized
DEBUG - 2010-03-06 19:57:41 --> URI Class Initialized
DEBUG - 2010-03-06 19:57:41 --> No URI present. Default controller set.
DEBUG - 2010-03-06 19:57:42 --> Router Class Initialized
DEBUG - 2010-03-06 19:57:42 --> Output Class Initialized
DEBUG - 2010-03-06 19:57:42 --> Input Class Initialized
DEBUG - 2010-03-06 19:57:42 --> Global POST and COOKIE data sanitized
DEBUG - 2010-03-06 19:57:42 --> Language Class Initialized
DEBUG - 2010-03-06 19:57:42 --> Loader Class Initialized
DEBUG - 2010-03-06 19:57:42 --> Database Driver Class Initialized

Any idea about what am I doing wrong?

I am using Windows Vista and I can access the database with the Administrator tool.

Thank you in advance.


MySql database in localhost - El Forum - 03-06-2010

[eluser]bgreene[/eluser]
config looks okay. the only suggestion i would make is to use the admin tool to create a new user with whatever rights you wish and try to logon using that user rather than root which is what you have at present