If you are using mysql from mamp for your laravel application and getting following error while displaying the data inside your application

SQLSTATE[HY000] [2002] Connection refused (SQL: select count(*) as aggregate from `products`)

Then you can solve this issue by just adding following line inside your .env file below the connection settings


It will solve your issue.

Leave a Reply

Your email address will not be published. Required fields are marked *