VimKanzo

Illuminate\Database\QueryException: SQLSTATE[HY000] [2002] No connection could be made because the target machine actively refused it.

laravel Icon

Illuminate\Database\QueryException

SQLSTATE[HY000] [2002] No connection could be made because the target machine actively refused it.

An unhandled exception occurred on line 678
675
        // message to include the bindings with SQL, which will make this exception a
676
        // lot more helpful to the developer instead of just the database's errors.
677
        catch (Exception $e) {
678
            throw new QueryException(
679
                $query, $this->prepareBindings($bindings), $e
680
            );

Solution

I'm running Laravel locally and I had mysql service stopped via Xampp. All I did was to start the SQL service using the Xampp control menu.            
Apr 10, 2021 Anyone

0 replies


Install the browser extension

Found this solution helpful? Try our extension for quick solutions to your Laravel errors.

Chrome logo Add to Chrome - It's free