title: How do I connect to a database on a different server, say db4free.net from a pdo codeigniter project hosted on heroku
body: <p>I am trying to host a codeigniter project on heroku, using an external mysql database at db4free.net.</p>
  
  <p>I have tried all I can to no avail but my last effort looks like this</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-html lang-html prettyprint-override"><code>$db['mysql'] = array(
   'dsn' =&gt; 'mysql:hostname="db4free.net"; dbname=ravenstock',
   'hostname' =&gt; '',
   'username' =&gt; 'ravenstockadmin',
   'password' =&gt; '**************',
   'database' =&gt; '',
   'dbdriver' =&gt; 'pdo',
   '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>
  </div>
  </div>
  </p>