ERROR: SQLSTATE[HY000] [2002] No connection could be made because the target machine actively refused it
If the WAMP icon is Orange then one of the services has not started.
In your case it looks like MySQL has not started as you are getting the message that indicates there is no server running and therefore listening for requests.
Look at the mysql log and if that tells you nothing look at the Windows event log, in the Windows -> Applications
section. Error messages in there are pretty good at identifying the cause of MySQL failing to start.
Sometimes this is caused by a my.ini file from another install being picked up by WAMPServers MySQL, normally in the \windows or \windows\system32 folders. Do a search for 'my.ini' and 'my.cnf' and if you find one of these anywhere outside of the \wamp.... folder structure then delete it, or at least rename it so it wont be found. Then restart the MySQL service.
php: SQLSTATE[HY000] [2002] No connection could be made because the target machine actively refused it
didn't you say your mysql port is 3306:
$db = new PDO("mysql:host=".DBHOST.";port=8889
//------------------------------------------^
this might help:
$db = new PDO("mysql:host=".DBHOST.";port=3306
SQLSTATE[HY000] [2002] No Connection Could Be Made
change port to DB_PORT=3306
the
run the following commands
1.php artisan config:clear
2.php artisan cache:clear
Related Topics
Wampserver PHPmyadmin Maximum Execution Time of 360 Seconds Exceeded
How to Add Square Braces Around Subarray Data Inside of a JSON Encoded String
A Recursive Remove Directory Function for PHP
Create Image from Url Any File Type
How to Change Variables in the .Env File Dynamically in Laravel
How to Export HTML Table to Excel or PDF in PHP
PHP Remove All Characters Before Specific String
Can't Find Fulltext Index Matching the Column List (Indexes Is Set)
PHP Get Both Array Value and Array Key
Htmlspecialchars VS HTMLentities When Concerned with Xss
Remove Duplicate Items from an Array
Crop or Mask an Image into a Circle
Get Variable from PHP File Using Jquery/Ajax
$Stmt->Execute():How to Know If Db Insert Was Successful
MySQL Get a Random Value Between Two Values