problems with database connection in laravel 5

Gaetan Sobze picture Gaetan Sobze · Feb 8, 2015 · Viewed 23.5k times · Source

I use the command php artisan migrate to migrate my database connection but I still get the same error and I checked everything, nothing wrong. I used the same connection that I always use in Laravel 4.2

Here is the message I get on my console:

exception 'PDOException' with message 'SQLSTATE[HY000] [1045] Access denied for user 'homestead'@'localhost' (using password: YES)' in C:\xampp\htdocs\Projects\blog\vendor\laravel\framework\src\Illuminate\Database\Connectors\Connector.php:47

Answer

baao picture baao · Feb 8, 2015

You need to change the values in your .env file, located in the root folder of your project.

If there is no .env file, copy the .env.example file to .env.

Laravel uses this file to protect your passwords. The values as you are setting those are only used if there is no configuration available in the .env file, homestead is the standard user there.