Laravel 7 - migrate:refresh got access denied

Viewed 139

I start to work on a laravel project that start by colleage. once I pulled down the git I want to do migration:

php artisan migrate:refresh

Immediately I got an error:

SQLSTATE[HY000] [1045] Access denied for user 'root'@'172.19.0.1' (using password: NO) (SQL: SHOW FULL TABLES WHERE table_type = 'BASE TABLE')

which seems odd because I checked all my config/database.php, .env, all point to 127.0.0.1 for mysql and not sure where 172.19.0.1 come from.

How can I debug this?

1 Answers

Please check your database, you have permissions issue for the database user.

Grant permissions for your db user root.

Execute the below command:

GRANT ALL PRIVILEGES ON dbname.* TO 'root'@'172.19.0.1';
FLUSH PRIVILEGES;
Related