Laravel manjaro linux中的php artisan迁移错误

Laravel manjaro linux中的php artisan迁移错误,laravel,manjaro,Laravel,Manjaro,我在manjaro linux中使用laravel。。如果我执行php artisan migrate命令,它会告诉我如何修复这个错误。另外,Im已经安装了xampp 谢谢 错误: Illuminate\Database\QueryException : could not find driver (SQL: select * from information_schema.tables where table_schema = nws and table_name = migrati

我在manjaro linux中使用laravel。。如果我执行php artisan migrate命令,它会告诉我如何修复这个错误。另外,Im已经安装了xampp 谢谢

错误:

Illuminate\Database\QueryException  : could not find driver (SQL: select * from     information_schema.tables where table_schema = nws and table_name = migrations and t    able_type = 'BASE TABLE')

at /run/media/snake/Entertainment/VS/linuxTest/Nurses/NW/vendor/laravel/framework/src/  Illuminate/Database/Connection.php:664
    660|         // If an exception occurs when attempting to run a query, we'll format the error
    661|         // message to include the bindings with SQL, which will make this exception a
    662|         // lot more helpful to the developer instead of just the database's errors.
 663|         catch (Exception $e) {
> 664|             throw new QueryException(
    665|                 $query, $this->prepareBindings($bindings), $e
    666|             );
    667|         }
    668|
Exception trace:

    1   PDOException::("could not find driver")
    run/media/snake/Entertainment/VS/linuxTest/Nurses/NW/vendor/laravel/framework/src/
    lluminate/Database/Connectors/Connector.php:70

      2 PDO::__construct("mysql:host=127.0.0.1;port=3306;dbname=nws", "root", "", [])
    /run/media/snake/Entertainment/VS/linuxTest/Nurses/NW/vendor/laravel/framework/src/
    Illuminate/Database/Connectors/Connector.php:70

    Please use the argument -v to see more details.

确保已安装Maria/MySQL及其PHP驱动程序

sudo pacman -Syu mariadb mariadb-clients libmariadbclient

我的解决方案是在.env中使用localhost而不是127.0.0.1

DB_HOST=127.0.0.1


试试这个,为我工作…

请在中显示您的DB部件。您是否安装了驱动程序?查看()可能重复的@AmalSR DB_CONNECTION=mysql DB_HOST=127.0.0.1 DB_PORT=3306 DB_DATABASE=nws DB_USERNAME=root DB_PASSWORD=
DB_HOST=localhost