title: Symfony: Doctrine - checking there's a connection
body: <p>Is there a simple way to debug why Doctrine is not connecting to MySQL?</p>
  
  <p><code>config.yml</code> has:</p>
  
  <pre><code># Doctrine Configuration
  doctrine:
      dbal:
          driver:   pdo_mysql
          host:     "%database_host%"
          port:     "%database_port%"
          dbname:   "%database_name%"
          user:     "%database_user%"
          password: "%database_password%"
  </code></pre>
  
  <p>and <code>parameters.yml</code> seems to have the correct connection information in it. E.g.</p>
  
  <pre><code>parameters:
      database_host: 127.0.0.1
      database_port: null
      database_name: &lt;my database name&gt;
      database_user: &lt;my database user&gt;
      database_password: &lt;my database password&gt;
  </code></pre>
  
  <p>However this piece of code still echoes out "Not connected". </p>
  
  <pre><code>    $cnx = $this-&gt;getDoctrine()-&gt;getConnection();
      if ($cnx-&gt;isConnected()){
          echo "Connected";
      }
      else {
          echo "Not connected";
      }
  </code></pre>
  
  <p>and I'm not getting any errors returned. </p>
  
  <p>Any suggestions?</p>