0

There are 2-3 same questions on this site but none of them gave me the right answer so i am asking it again.

I have just installed codeigniter yesterday and was watching some tutorial. But when i tried to access database i started to get the following error

        Unable to connect to your database server using the provided settings.

           Filename: C:\wamp\www\test\system\database\DB_driver.php

              Line Number: 124

I changed nothing in the settings. Just installed wamp server and then created a database named asik and then created a table name bcc. Here is the database.php file:

     $db['default']['hostname'] = 'localhost';
     $db['default']['username'] = 'root';
     $db['default']['password'] = 'root';
     $db['default']['database'] = 'asik';
     $db['default']['dbdriver'] = 'mysqli';
     $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;

(I also auto loaded the database.)

This is what I did before getting the error. I have tried all day and could not find any way to solve it. Please advise.

1
  • is the password 'root' or just a blank '' Commented Aug 6, 2012 at 14:51

2 Answers 2

2

You must be watching scratch video tutorials from youtube. Its really great for beginners. I faced the same problem.

Anyway the answer will be

   $db['default']['password'] = '';

If you do not use any password for the database then you don't have to use any password but username should be root.

Sign up to request clarification or add additional context in comments.

1 Comment

In the tutorial they showed the password should be root and it worked for them. But it did not work for me. Anyway thanks for the help.
0

only verify username, password, database name and one line above these configs

$active_group = 'default';

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.