I got this error when I logged in.
I tried:
+ php artisan cache:clear
+ php artisan view:clear
+ php artisan key:generate
+ php artisan config:cache.
I also restarted the server!
My code:
DB_CONNECTION=mysql
DB_HOST=http://45.77.34.158/phpmyadmin
DB_PORT=3306
DB_DATABASE=dataname
DB_USERNAME=user
DB_PASSWORD=12345679
My server is an online server!
Can anybody tell me where I am wrong?
I use php7.3.9, laravel 5.7, composer 1.9.1.
Thanks!
https://diy.stackexchange.com
4
Answers
the host should not be an URL, instead use only the IP ADDRESS.
DB_HOST
should be IP Address onlyDB_HOST=http://45.77.34.158/phpmyadmin
DB_HOST=45.77.34.158
if that doesn’t work then run this command this will help you to clear cached config
php artisan cache:clear
In .env file change DB_HOST=??????? to DB_HOST=localhost