DB_CONNECTION=mysql
DB_HOST=127.0.0.1
DB_PORT=3306
DB_DATABASE=
DB_USERNAME=root
DB_PASSWORD=
this is my configuration for laravel 5.4 but php artisan migrate is not working and have error and the migrate error
Users-MacBook-Pro: ATP Developers php artisan migrate
In Connection.php line 664:
SQLSTATE[HY000] [1045] Access denied for user ''@'localhost' (using password: NO) (SQL: select * from information_schema.tables where table schema = atp_db and table_name = migrations)
In Connector.php line 87:
SQLSTATE[HY000] [1045] Access denied for user ''@'localhost' (using password: NO)
I faced a similar problem. So, I run the following commands as mentioned at
https://laracasts.com/discuss/channels/general-discussion/env-file-and-config-keys-not-updating-after-change,
php artisan cache:clear
php artisan config:clear
php artisan route:clear
Also, make sure to restart the server as well
php artisan serve
you should write these:
DB_DATABASE = your database name
DB_USERNAME = root
DB_PASSWORD = your password
and again run php artisan serve
to make sure about saving .env
and again run php artisan migrate
Indeed I had the same problem, I can not explain why Laravel indicates the old Host but the solution is to change the password.
Use below => php artisan config:cache
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With