Illuminate\Database\QueryException could not find driver

Updated at 23-Feb-2022, By samar

IlluminateDatabaseQueryException could not find driver

In this article, we will see how to solve "IlluminateDatabaseQueryException could not find driver".

You have to enable the pdo_mysql extension in php.ini file to avoid the error Illuminate\Database\QueryException could not find driver in Laravel
  • Enable pdo_mysql using php.ini file

    --PATH E:\laragon\bin\php\php-8.0.16-Win32-vs16-x64\php.ini
    extension=pdo_mysql
    

    Just remove the ; from the ;extension=pdo_mysql in the php.ini file to avoid the exception in Laravel.

    File path may be different.

Back to code snippet queries related laravel