title: Codeigniter database reconnect not working
body: <p>I have a controller that does uploading to the host server and another controller that does uploading to youtube. After the former controller does its job, it redirects to the latter. After a particularly long uploading process which involves youtube, I was getting "MySQL server has gone away" errors </p>
  
  <p>I used this code to reconnect to database in Codeigniter to solve that problem.</p>
  
  <pre><code>$this-&gt;db-&gt;reconnect();
  </code></pre>
  
  <p>Instead I got an error</p>
  
  <pre><code>A Database Error Occurred
  Unable to select the specified database: test_database
  ....
  </code></pre>
  
  <p>I tried adding this code before and after the "reconnect" code but it did not help('test' below is the name of the active group in the database config I am using.)</p>
  
  <pre><code>$this-&gt;load-&gt;database('test');
  </code></pre>
  
  <p>Anyone have an idea how to solve this?</p>