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


  • | 429 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:
    0_1567612838508_error.png

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

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


  • | 429 points

    To elaborate:

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


  • | 442 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


  • | 429 points

    Good idea, I checked it and it seems the extension "pdo_mysql" is activated:
    0_1567622120832_extension.PNG


  • | 429 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.

    Solution:
    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:
    0_1567623525648_migration.PNG

    Thanks anyways @flick36


  • | 442 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.


  • | 429 points

    I agree now :)


Log in to reply
 

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