P. Jhon
P. Jhon

Reputation: 33

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.

Upvotes: 3

Views: 1510

Answers (2)

Plycoder
Plycoder

Reputation: 726

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.

Upvotes: 1

Balazs Szabo
Balazs Szabo

Reputation: 51

You must set the database connection in .env file.

Upvotes: 1

Related Questions