title: How do I set up a database for Symfony2 using Doctrine?
body: <p>I'm following the Symfony book and arrived at <a href="http://symfony.com/doc/current/book/doctrine.html" rel="nofollow">the chapter on dealing with the database</a>. I have a few questions, and can't seem to find an answer.</p>
  
  <p>I'm just following the parameters.yml file that I have looks like this (auto-generated)</p>
  
  <pre><code>parameters:
      database_driver: pdo_mysql
      database_host: 127.0.0.1
      database_port: null
      database_name: myproject
      database_user: root
      database_password: null
      mailer_transport: smtp
      mailer_host: 127.0.0.1
      mailer_user: null
      mailer_password: null
      locale: en
      secret: ThisTokenIsNotSoSecretChangeIt
      debug_toolbar: true
      debug_redirects: false
      use_assetic_controller: true
  </code></pre>
  
  <p>Then I head over to the terminal and enter:</p>
  
  <pre><code>php app/console doctrine:database:create
  </code></pre>
  
  <p>I receive the following error:</p>
  
  <pre><code>Could not create database for connection named `myproject`
  SQLSTATE[HY000] [2002] Connection refused
  </code></pre>
  
  <p>I have a few questions:</p>
  
  <ul>
  <li>How do I fix this</li>
  <li>Where is the database server? Did it come when I installed Symfony2 with Composer?</li>
  </ul>