title: Unable to connect to your database server using the provided settings in Codeigniter
body: <p>Actually I'm trying to configure my codeigniter live file to localhost.</p>
  
  <p>I have,</p>
  
  <ol>
  <li>created a database called test_bs</li>
  <li>then imported the tables</li>
  <li>Then change the <code>base_url</code> like <code>$config['base_url']=http://localhost/gu_ci/'</code>; and <code>$config['index_page']='index.php';</code> in config.php</li>
  <li><p>And then did a change on database.php,Which contains</p>
  
  <pre><code>$active_group = 'default';
  $active_record = TRUE;
  
  $db['default']['hostname'] = 'localhost';
  $db['default']['username'] = 'root';
  $db['default']['password'] = ' ';
  $db['default']['database'] = 'test_bs';
  $db['default']['dbdriver'] = 'mysql';
  $db['default']['dbprefix'] = '';
  $db['default']['pconnect'] = TRUE;
  $db['default']['db_debug'] = TRUE;
  $db['default']['cache_on'] = TRUE;
  $db['default']['cachedir'] = 'application/cache/';
  $db['default']['char_set'] = 'utf8';
  $db['default']['dbcollat'] = 'utf8_general_ci';
  $db['default']['swap_pre'] = '';
  $db['default']['autoinit'] = TRUE;
  $db['default']['stricton'] = FALSE;
  </code></pre></li>
  </ol>
  
  <p>My .htacess file having:</p>
  
  <pre><code>  RewriteEngine On
    RewriteBase /new_admin/
  
    RewriteCond %{REQUEST_URI} PIE.htc
    AddType text/x-component .htc
    RewriteRule (.*) static/PIE.htc [L]
  
    RewriteCond %{REQUEST_URI} !^/new_admin/static/
  
    RewriteRule (.*)$ index.php [L]
  </code></pre>
  
  <p>I'm getting the following error:</p>
  
  <pre><code>     A Database Error Occurred
  
       Unable to connect to your database server using the provided settings.
  
       Filename: C:\xampp\htdocs\gunify_ci\system\database\DB_driver.php
  
       Line Number: 124
  </code></pre>
  
  <p>I have referred <a href="https://stackoverflow.com/questions/22877227/codeigniter-a-database-error-occurred">Refer1</a>, <a href="https://stackoverflow.com/questions/15190196/codeigniter-issue-with-database">Refer2</a>,<a href="https://stackoverflow.com/questions/17912508/a-database-error-occurred">Refer3</a>,<a href="https://stackoverflow.com/questions/22533644/codeigniter-error-unable-to-connect-to-database-using-the-provided-settings">Refer4</a>,<a href="https://stackoverflow.com/questions/9545081/codeigniter-error-unable-to-connect-to-your-database-server-using-the-provided">Refer5</a> and so on... The last link just display the welcome message like:
  <img src="https://i.stack.imgur.com/LzQtp.png" alt="enter image description here">
  But none of the solution helped me!!</p>
  
  <p>Guide me to solve this!!</p>