P. Jhon P. Jhon - 23 days ago 6
MySQL Question

PDOException SQLSTATE[28000] [1045] Access denied for user 'homestead'@'localhost'

I am new in Laravel 5.2.

I am getting following error:

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


While I execute following command:

php artisan migrate


I am running application using vagrant on windows PC.
Please let me know why I am getting above error.

Thanks in advance.

Answer

You are getting above error because on your .env file. If you open that from your project base directory then you will following default configuration:

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

Just change above values according to your development environment. Try again, Hopefully that would resolve your issue.

Comments