title: Codeigniter Database Connection to MySql Server
body: <p>I have a WAMP server with the following credentials for the MySQL:</p>
  
  <pre><code>username: root
  password: ''
  </code></pre>
  
  <p>But when I configure the <code>$autoload['libraries'] = array('database');</code>, I get this error:</p>
  
  <pre><code>A PHP Error was encountered
  
  Severity: Warning
  
  Message: mysqli::real_connect(): (HY000/1045): Access denied for user 'root'@'localhost' (using password: NO)
  
  Filename: mysqli/mysqli_driver.php
  
  Line Number: 202
  
  Backtrace:
  
  File: C:\wamp\www\ci\index.php
  Line: 315
  Function: require_once
  
  A Database Error Occurred
  
  Unable to connect to your database server using the provided settings.
  
  Filename: C:/wamp/www/ci/system/database/DB_driver.php
  
  Line Number: 436
  </code></pre>
  
  <p>If I'm not mistaken, it is asking for a password in MySQL to which I did not put one. Below is the configuration at Codeigniter's database.php.</p>
  
  <pre><code>$active_group = 'default';
  $query_builder = TRUE;
  
  $db['default'] = array(
      'dsn'   =&gt; '',
      'hostname' =&gt; 'localhost',
      'username' =&gt; 'root',
      'password' =&gt; '',
      'database' =&gt; 'sandbox',
      'dbdriver' =&gt; 'mysqli',
      'dbprefix' =&gt; '',
      'pconnect' =&gt; FALSE,
      'db_debug' =&gt; (ENVIRONMENT !== 'production'),
      '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(),
      'save_queries' =&gt; TRUE
  </code></pre>
  
  <p>Thank you for the help.</p>