I try to run xampp on window 7. My php version is php 7.3.2.
After run composer install
, I run php artisan migrate
.
My error is:
SQLSTATE[HY000] [1044] Access denied for user ”@’localhost’ to database ‘inventory’ (SQL: select * from information
_schema.tables where table_schema = inventory and table_name = migrations)
and
SQLSTATE[HY000] [1044] Access denied for user ”@’localhost’ to database ‘inventory’
2
Answers
You forgot to set
DB_USERNAME=
in the .env file, so you’re getting this error:Open the .env file and edit it. Just set up correct DB credentials:
DB_USERNAME
should be set toroot
if you do not have a default username in the installation timeAfter changes of .env enter this command in your terminal for clear cache:
php artisan config:cache
NOTE: If you’re still getting error
Check your database configuration with tinker.
then write this will give you whole configuration check is it right or not.
Make sure your xampp is running.
Then after editing the
.env
file run below command.and then run,