php artisan migrate on Azure (in BitBucket pipeline) php artisan migrate on Azure (in BitBucket pipeline) azure azure

php artisan migrate on Azure (in BitBucket pipeline)


This error basically comes from the after changes in the .env file:

Illuminate\Database\QueryException : SQLSTATE[HY000] [1045] Access denied for user 'forge'@'127.0.0.1' (using password: NO) (SQL: select * from information_schema.tables where table_schema = forge and table_name = migrations)

Whenever we change the DB_DATABASE, DB_USERNAME and DB_PASSWORD in .env file, we need to clear the cache.

After completion of .env edit, must be clear cache: php artisan config:cache

NOTE: If no password is set on the database, clear it DB_PASSWORD, empty space must also be removed(In the past I've also faceout this problem, It's consider blank space as a password)


Without seeing your deploy script and how you are connecting with your Azure server you would need to put

php artisan config:clear // This will reload the .env file to cache

after you have connected to your server but before you run

php artisan migrate


Please checkout the link:

https://laravel.com/docs/5.7/configuration#configuration-caching

php artisan config:cache

The above command will just regenerate the cache for you. (if added as a part of deployment script)

Else you can use php artisan config:clear just to clear the existing config and fetch values from .env/config files (add as a part of your deployment script)