Reputation: 23
I am new in programming. I mistakenly changed my .env
file from production server into the local .env
file in my Laravel project.
I created a new env file, filled the data about DB, made php artisan key:generate
, started the commands:
php artisan config:clear
php artisan route:clear
php artisan view:clear
php artisan cache:clear
composer dump-autoload
But the server still shows SQLSTATE[HY000] [2002] Connection refused.
Maybe sommebody knows what else can I do to make the server work with the new env. Any help appreciated.
My settings changed in the new file:
APP_ENV=production
APP_KEY=base64key
APP_DEBUG=false APP_URL=url
LOG_CHANNEL=stack
DB_CONNECTION=mysql
DB_HOST=host_name
DB_PORT=3306
DB_DATABASE=db name
DB_USERNAME=user name
DB_PASSWORD=password name
Upvotes: 1
Views: 554
Reputation: 23
I found the problem: I fixed the .env
file correctly but mixed my new and old Git branches, so the wrong Git-Branch pulled onto the production server. Silly mistake!
Upvotes: 1