[php artisan命令说缺少驱动程序

问题描述 投票:0回答:2

我的大多数php artisan命令都会报告一个错误:

    C:\Projects\bapestore>php artisan migrate

   Illuminate\Database\QueryException

  could not find driver (SQL: select * from information_schema.tables where table_schema = bapestore and table_name = migrations and table_type = 'BASE TABLE')

  at C:\Projects\bapestore\vendor\laravel\framework\src\Illuminate\Database\Connection.php:669
    665|         // If an exception occurs when attempting to run a query, we'll format the error
    666|         // message to include the bindings with SQL, which will make this exception a
    667|         // lot more helpful to the developer instead of just the database's errors.
    668|         catch (Exception $e) {
  > 669|             throw new QueryException(
    670|                 $query, $this->prepareBindings($bindings), $e
    671|             );
    672|         }
    673|

  1   C:\Projects\bapestore\vendor\laravel\framework\src\Illuminate\Database\Connectors\Connector.php:70
      PDOException::("could not find driver")

  2   C:\Projects\bapestore\vendor\laravel\framework\src\Illuminate\Database\Connectors\Connector.php:70
      PDO::__construct()

我刚刚在Windows 10上本地安装了PHP7,Laravel,MAMP和MySQL Workbench,以便能够在家中进行更多练习。 (主,这是一个麻烦。.)现在我正在尝试连接数据库,但是我遵循的教程使用的是Mac OS ..因此,我无法按照那里的指示进行操作。

任何人都可以理解该错误吗?

mysql laravel mysql-workbench mamp php-7
2个回答
1
投票
您很可能缺少PHP扩展名。如果能够找到php.ini文件,则搜索extension=mysqliextension=pdo_mysql扩展名。您可能需要取消注释它们才能启用扩展。

0
投票
在终端中输入
© www.soinside.com 2019 - 2024. All rights reserved.