skip to Main Content

I got this error when I logged in.
enter image description here

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


  1. the host should not be an URL, instead use only the IP ADDRESS.

    DB_HOST=45.77.34.158
    
    Login or Signup to reply.
  2. DB_CONNECTION=mysql
    DB_HOST=45.77.34.158
    DB_PORT=3306
    DB_DATABASE=dataname
    DB_USERNAME=user
    DB_PASSWORD=12345679
    
    Login or Signup to reply.
  3. DB_HOST should be IP Address only

    Change

    DB_HOST=http://45.77.34.158/phpmyadmin

    to

    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

    Login or Signup to reply.
  4. In .env file change DB_HOST=??????? to DB_HOST=localhost

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search