Home > other >  No connection could be made because the target machine actively refused it in laravel
No connection could be made because the target machine actively refused it in laravel

Time:04-24

Illuminate\Database\QueryException SQLSTATE[HY000] [2002] No connection could be made because the target machine actively refused it. (SQL: select * from admins where username = [email protected] limit 1) http://127.0.0.1:8000/admin

CodePudding user response:

enter image description here

Check Your Apache and MySql is on or off. from Xampp or lampp or any sql service provide.

CodePudding user response:

This error tell you that you are not connected to selected database .

Check your database service provider e.g xampp,lampp , ... and check it works.

if you dont use database service provider and run database by your self check that you can login in it via terminal .

for example in ubuntu try :

sudo mysql -u <username> -p <password>

after that check your .env file located to your root directory

these line should connect properly to your database

DB_CONNECTION=mysql
DB_HOST=127.0.0.1
DB_PORT=3306
DB_DATABASE=<your_database_name>
DB_USERNAME=<your_username>
DB_PASSWORD=<your_password>
  • Related