Did you check if the MySQL service is running?
Nov 17, 2024
5
Level 1
SQLSTATE[HY000] [2002] No connection could be made because the target machine actively refused it
Mostly whenever I start my laragon server and try to run ' php artisan serve' on my terminal, The error ' No connection could be made because the target machine actively refused it' shows up. Even though after i restart my pc and do the same thing it works just fine , i am looking a better solution here since i don't want to restart pc every time i want to open up a project. I use
DB_CONNECTION=mysql DB_HOST=localhost DB_PORT=3306
for all of my projects in their .env file.
I've tried netstat -aon | findstr 3306 to see if anything occupied the port, but nothing shows up.
Please or to participate in this conversation.