title: CodeIgniter PDO database driver not working
body: <p>I'm trying to use the PDO MySQL driver in my CodeIgniter application. This is my database config:</p>
  
  <pre><code>$active_group = 'default';
  $active_record = TRUE;
  
  $db['default']['hostname'] = 'localhost';
  $db['default']['username'] = 'root';
  $db['default']['password'] = '';
  $db['default']['database'] = 'testdatabase';
  $db['default']['dbdriver'] = 'pdo';
  $db['default']['dbprefix'] = '';
  $db['default']['pconnect'] = TRUE;
  $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;
  </code></pre>
  
  <p>However, I'm getting this error when I load a controller:</p>
  
  <blockquote>
    <p>Fatal error: Uncaught exception 'PDOException' with message 'invalid
    data source name' in
    C:\xampp\htdocs\testsite\system\database\drivers\pdo\pdo_driver.php:114</p>
  </blockquote>
  
  <p>I've checked the data source using <code>die($this-&gt;hostname);</code> in <code>pdo_driver.php</code> and it's coming out as:</p>
  
  <pre><code>localhost;dbname=testdatabase
  </code></pre>
  
  <p>so it is getting the correct database name. The database exists and I do have MySQL running.</p>
  
  <p>What could be going wrong here? Thank you.</p>