Laravel error with php artisan migrate
<p>I'm trying to follow this guide:
<a href="https://laravel.com/docs/5.2/quickstart" rel="nofollow">https://laravel.com/docs/5.2/quickstart</a></p>

<p>I'm running ubuntu 14.04 on aws. I'm using laravel 5.2. I'm new to laravel (and aws too for that matter), I've done everything in the guide and get this error.  </p>

<p>When I run:  </p>

<blockquote>
  <p>php artisan migrate</p>
</blockquote>

<p>I get the following error: </p>

<blockquote>
  <p>[PDOException] </p>
  
  <p>SQLSTATE[28000] [1045] Access denied for user
  'homestead'@'localhost' (usin g password: YES)</p>
</blockquote>

<p>The .env file looks like this: </p>

<pre><code>APP_ENV=local APP_DEBUG=true APP_KEY=hXP0uBJkQos3cHK7D8f6LVx2SLuLAuyv

DB_HOST=localhost 
DB_DATABASE=homestead 
DB_USERNAME=homestead 
DB_PASSWORD=secret

CACHE_DRIVER=file 
SESSION_DRIVER=file 
QUEUE_DRIVER=sync

REDIS_HOST=localhost 
REDIS_PASSWORD=null 
REDIS_PORT=6379

MAIL_DRIVER=smtp 
MAIL_HOST=mailtrap.io 
MAIL_PORT=2525 MAIL_USERNAME=null 
MAIL_PASSWORD=null MAIL_ENCRYPTION=null
</code></pre>

<p>Edit: Okay, so I guess this problem was due to a lack of understanding of ubuntu, mysql and laravel. I followed the guide in the link above exactly but I guess it was meant for people running homestead. It looks like on an ubuntu server you have to manually create the database (guess it seems obvious to most). </p>

<p>So login to mysql with:</p>

<pre><code>mysql -u root -p
</code></pre>

<p>Then enter the password when you are prompted for it.</p>

<p>It's probably not a good idea to use root but I'm just learning so yea.
The password you enter here is the same password you have to enter in the .env file in the laravel root directory.</p>

<p>Once logged into mysql enter:</p>

<pre><code>mysql&gt; create database homestead;
</code></pre>

<p>This creates a database with the same name as the one specified in the .env file DB_DATABASE=homestead. I should probably change it from homestead as I'm not using homestead :/</p>

<p>The DB_USERNAME is the same username that we use to log into mysql so</p>

<pre><code>DB_USERNAME = root
</code></pre>

<p>While the password is the same password we used to log into mysql.</p>

<p>This probably all seems obvious but I'm new and had no idea. It also wasn't covered in the quickstart guide on the laravel website. Maybe I didn't follow it accurately, if so let me know.</p>

<p>Cheers</p>