0

I run wamp and try to connect to db but I got

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

Few faqs / what I've done:

  1. I autoloaded the database library in config.php
  2. my phpMyAdmin doesn't have any username and pass set
  3. this is the setting in database.php
$db['default'] = array(
  'dsn'   => '',
  'hostname' => 'localhost',
  'username' => '',
  'password' => '',
  'database' => 'ciintro',
  'dbdriver' => 'mysqli',
  'dbprefix' => '',
  'pconnect' => TRUE,
  'db_debug' => TRUE,
  'cache_on' => FALSE,
  'cachedir' => '',
  'char_set' => 'utf8',
  'dbcollat' => 'utf8_general_ci',
  'swap_pre' => '',
  'autoinit' => TRUE,
  'encrypt' => FALSE,
  'compress' => FALSE,
  'stricton' => FALSE,
  'failover' => array(),
  'save_queries' => TRUE
);
2
  • try a simple mysql_connect() in index.php and see if that works Commented Nov 21, 2014 at 3:14
  • I solved this, the username should equal to 'root'. Commented Nov 21, 2014 at 3:25

2 Answers 2

2

'username' => '',

should be

'username' => 'root',

check username.

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

Comments

0

I think you are newer to codeigniter.

'username' => 'root' ( root or whatever you set for PHPMYADMIN.)

'password' => 'password' ( password or whatever you set for PHPMYADMIN.)

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.