artisan migrate -> Illuminate\Database\QueryException : could not find driver

  • | 667 points

    Hi guys,

    Issue: "php artisan migrate" not working, what am I doing wrong?

    After creating a Laravel test project called 'adam' (via "Quick app"/Laravel (zip), I run "php artisan make:auth" (successfully) in the Terminal.

    Then I want to create the migrations with "php artisan migrate" but this gives me the following error:

    My .env file is configured correctly as: (I added the db passwort 'root' via 'Menu/MySQL/Change root password")

    What am doing wrong / How can I fix this?
    Thanks for your tipps.

  • | 667 points

    To elaborate:

    I can login with 'root, 'root' in PHPMyAdmin (via or via localhost/phpmyadmin) and there's also a database called 'adam' without any tables in it:

  • | 654 points

    @laradom Do you have pdo_mysql extension activated?

    Right click on Laragon icon > PHP > Extensions

    Make sure the the pdo_mysql extension is checked

  • | 667 points

    Good idea, I checked it and it seems the extension "pdo_mysql" is activated:

  • | 667 points

    I found it! My system was overloaded with prior XAMP installations and stuff, in short a total mess. Since there was another PHP folder under C:/PHP/ my php.ini file there referred to the extension folder "C:/PHP/ext" instead of to the laragon one in the laragon folder.

    I changed the key "extension_dir" in c:/PHP/win.ini from extension_dir = "C:/PHP/ext" to
    extension_dir= "D:\laragon\bin\php\php-7.2.19-Win32-VC15-x64\ext" (where laragon is installed in my case).

    and voilĂ  it works:

    Thanks anyways @flick36

  • | 654 points

    Well, as a recommendation, you should just uninstall every XAMP instance you may have, including that php folder, and just let laragon do all the heavy work.

  • | 667 points

    I agree now :)

Log in to reply

Looks like your connection to Laragon was lost, please wait while we try to reconnect.