How to Fix SQLSTATE[HY000] [2002] Connection Refused in Laravel
Laravel throws SQLSTATE[HY000] [2002] Connection refused when PHP cannot reach MySQL at all. Here is how to find which of the six usual causes is yours โ and fix it for good.
Posts about MySQL 8.
2 articles
Laravel throws SQLSTATE[HY000] [2002] Connection refused when PHP cannot reach MySQL at all. Here is how to find which of the six usual causes is yours โ and fix it for good.
A slow query is usually a missing index. This guide explains how MySQL indexes actually work, how to read EXPLAIN, and how to add the right indexes without overdoing it.