Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Access denied for user 'homestead@localhost' .. in laravel 5

Tags:

laravel-5

I use the command php artisan migrate to migrate my db in laravel 5 .. it gives me an error:

exception 'PDOException' with message 'SQLSTATE[HY000] [1045] Access denied for user 'homestead'@'localhost' (using password: YES)'

like image 330
shimaa Avatar asked Feb 21 '15 09:02

shimaa


2 Answers

Sometime in the future. Try to clear your config first

php artisan config:clear. 

Close all the terminal /cmd windows and then restart terminal/CMD and this should get rid of the error message. See if it works.

like image 167
Krishneil Avatar answered Oct 14 '22 23:10

Krishneil


In your Laravel .env file, alter the variables accordingly to match your desired settings.

If you're using something like XAMMP or EasyPHP with a mysql db, perhaps use the following setup

 DB_HOST=localhost
 DB_DATABASE=mysql
 DB_USERNAME=root
 DB_PASSWORD=''
like image 28
jurg Hurg Avatar answered Oct 14 '22 22:10

jurg Hurg