Welcome Guest, Not a member yet? Register   Sign In
error connecting to mysql with v2.1.2
#1

[eluser]jayreis[/eluser]
I am new to using CI and just downloaded v2.1.2
I created a new database and setup the needed tables in my myphpadmin
I then edited the file application/config/database.php to have my database name and connection information
I then edited the autoload php file to have a line that looks like this

$autoload['libraries'] = array('database');

I then am following the video tutorial on making a demo blog from the video tutorial on this website. However when I try to go to what would be the demo page I just get a Error establishing a database connection error and I am not sure why?

Suggestions on where to look to fix this?
#2

[eluser]TWP Marketing[/eluser]
Do you password and database name match the ones used to create the db?
#3

[eluser]jayreis[/eluser]
yes the username, password and the database name all match the correct credentials for my mysql database in fact I made a regular php page to test the connection details and it works fine. So it is only some misconfig within CI itself which is why I m lost

#4

[eluser]InsiteFX[/eluser]
Being as your autoloading the database the would be in your database.php config file.

If pconnect = TRUE change it to FALSE.
#5

[eluser]jayreis[/eluser]
I changed the pconnect to false and still no change??

Code:
$active_group = 'default';
$active_record = TRUE;

$db['default']['hostname'] = 'localhost';
$db['default']['username'] = '****';
$db['default']['password'] = '***';
$db['default']['database'] = '*****';
$db['default']['dbdriver'] = 'mysql';
$db['default']['dbprefix'] = '';
$db['default']['pconnect'] = FALSE;
$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;

Of course the username and password and actual database name as been ** out in my real file I have the real values
#6

[eluser]TWP Marketing[/eluser]
Which video tutorial are you using?
#7

[eluser]jayreis[/eluser]
I did what was in the first video and now I am watching
http://codeigniter.com/tutorials/watch/blog/

I believe the video is a bit outdated since some of the directories are different in 2.1.2
#8

[eluser]TWP Marketing[/eluser]
I'm stuck with the linux flash/h264 problem and cannot watch the video online. (hint to CI, let us download the videos and play them off-line).
#9

[eluser]InsiteFX[/eluser]
Do the pages and news tutorial in the CodeIgniter Users Guide.




Theme © iAndrew 2016 - Forum software by © MyBB