title: mysqli::real_connect(): (HY000/1049): Unknown database error in codeigniter
body: <p>I'm new to Codeigniter PHP framework. When I'm testing my application I get 'Unknown database db_name' error. I have browsed through several sites but didn't found solution for the problem as I'm trying the same to connect with wamp's mysql database. Any help would be appreciable.</p>
  
  <p>Following is database.php in config folder:  <a href="https://i.stack.imgur.com/0Kqnf.jpg" rel="nofollow noreferrer">image describing <strong>Test</strong> database</a>:</p>
  
  <pre><code>$active_group = 'default';
  $query_builder = TRUE;
  
  $db['default'] = array(
      'dsn'   =&gt; '',
      'hostname' =&gt; 'localhost',
      'username' =&gt; 'root',
      'password' =&gt; '',
      'database' =&gt; 'test',
      'dbdriver' =&gt; 'mysqli',
      'dbprefix' =&gt; '',
      'pconnect' =&gt; TRUE,
      'db_debug' =&gt; TRUE,
      'cache_on' =&gt; FALSE,
      'cachedir' =&gt; '',
      'char_set' =&gt; 'utf8',
      'dbcollat' =&gt; 'utf8_general_ci',
      'swap_pre' =&gt; '',
      'encrypt' =&gt; FALSE,
      'compress' =&gt; FALSE,
      'stricton' =&gt; FALSE,
      'failover' =&gt; array()
  );
  </code></pre>