title: How to connect to mysql with laravel?
body: <p>This is such a simple basic question I don't think there is much people asking this but simply how do I connect to mySql through localhost phpmyadmin with laravel (I've searched, there is some stuff, but I need to ask because I am a noob and I'd like to ask, the stuff I saw I don't quite get 100% or I tried and it didn't help)?</p>
  
  <p>I am working with <a href="http://backbonejs.org/" rel="noreferrer">backbone.js</a> and am brand new to <a href="https://laravel.com/" rel="noreferrer">laravel</a>, I installed <a href="https://laravel.com/" rel="noreferrer">laravel</a> inside <code>C:\wamp\www\laravel-project</code> </p>
  
  <p>I tried </p>
  
  <pre><code>c:\wamp\www\laravel-project&gt; php artisan migrate:make create_tasks_table --table tasks --create
  </code></pre>
  
  <p>And</p>
  
  <pre><code>c:\wamp\www\laravel-project&gt; php artisan migrate
  </code></pre>
  
  <p>I expect to have to define the database information, I checked <code>C:\wamp\www\laravel-project\app\config\database.php</code> and it looks correct, mySQL is set on the defaults <code>root</code> being the user name, and '' empty being the password.</p>
  
  <p>The error in the command line I get after running <code>php artisan migrate</code> is</p>
  
  <pre><code>[PDOException]
  SQLSTATE[HY000] [1049] Unknown database 'database'    
  </code></pre>
  
  <p>I am using windows 8, and wamp for my localhost server, it of course includes phpmyadmin and mySql. So I am sure there are tons of ways to use mySql but I don't think I am setting up <a href="https://laravel.com/" rel="noreferrer">laravel</a> and phpmyadmin properly.</p>
  
  <p>So any insight would be amazing, easy points. </p>
  
  <p><strong>EDIT:</strong> </p>
  
  <p>Actually thinking this through maybe I need to create a database named <code>database</code> let me try that. be back soon. Okay I'll answer my question or someone can, just in case someone searches this topic... it is <strong>KEY</strong> to make sure the database defined in <code>C:\wamp\www\laravel-project\app\config\database.php</code> matches a database that exists inside your phpmyadmin. No brainer!</p>