Artisan migrate could not find driver

前端 未结 11 806
情话喂你
情话喂你 2020-11-27 17:33

I am trying to install Laravel. I have installed Xampp, but when I try to setup my database using php artisan migrateI get the error:

相关标签:
11条回答
  • 2020-11-27 18:08

    In your php.ini configuration file simply uncomment the extension:

    ;extension=php_pdo_mysql.dll
    

    (You can find your php.ini file in the php folder where your stack server is installed.)

    If you're on Windows make it: extension=php_pdo_mysql.dll

    If you're on Linux make it: extension=pdo_mysql.so

    And do a quick server restart.

    If this isn't working for you, you may need to install pdo_mysql extension into your php library.

    0 讨论(0)
  • 2020-11-27 18:10

    I am a Windows and XAMPP user. What works for me is adding extension=php_pdo_mysql.dll in both php.ini of XAMPP and php.ini in C:\php\php.ini.

    Run this command in your cmd to know where your config file is

    php -i | find /i "Configuration File

    0 讨论(0)
  • 2020-11-27 18:10

    If you are on linux systems please try running sudo php artisan migrate As for me,sometimes database operations need to run with sudo in laravel.

    0 讨论(0)
  • 2020-11-27 18:18

    whilst sometimes you might have multiple php versions, you might also have a held-back version of php-mysql.. do a sudo dpkg -l | grep mysql | grep php and compare what you get from php -v

    0 讨论(0)
  • 2020-11-27 18:18
    Go to .env file and change the following
    DB_CONNECTION=mysql
    DB_HOST=127.0.0.1
    DB_PORT=3306
    DB_DATABASE=shreemad
    DB_USERNAME=root
    DB_PASSWORD=
    

    Change the DB_PASSWORD field to

    DB_CONNECTION=mysql
    DB_HOST=127.0.0.1
    DB_PORT=3306
    DB_DATABASE=shreemad
    DB_USERNAME=root
    DB_PASSWORD=" "
    

    In my case it works

    NOTE: If your password in mysql is null

    0 讨论(0)
提交回复
热议问题