When I upload Laravel website form local to live server this error that I face

285 Views Asked by At

When I upload Laravel website form local to live server that I face this error

SQLSTATE[HY000] [2002] Connection refused (SQL: select * from `sessions` where `id` = E70KsnO9rKtK9ATW71zmd9AfGW1ek7nAhnD2wQjS limit 1)

2

There are 2 best solutions below

0
IslamYearul On

Please Check All of your Database connection From .env File

DB_CONNECTION=MySQL
DB_HOST=127.0.0.1
DB_PORT=3306
DB_DATABASE=pottered
DB_USERNAME=root
DB_PASSWORD=
0
Somar kn On

Well, that's a list of things you have to check.

  1. First, make sure the database is correctly created
  2. Make sure you create a user for the database
  3. Make sure this user is given all the privileges required to work on the database
  4. Make sure the linkage information in file .env