首页 > 解决方案 > php artisan migrate 命令错误:找不到驱动程序

问题描述

我的操作系统是windows

Illuminate\Database\QueryException : 找不到驱动程序 (SQL: select * from information_schema.tables where table_schema = blog and table_name = migrations)

  at E:\Programme\Laravel Lab\blog\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")
      E:\Programme\Laravel Lab\blog\vendor\laravel\framework\src\Illuminate\Database\Connectors\Connector.php:68

  2   PDO::__construct("mysql:host=127.0.0.1;port=3306;dbname=blog", "root", "root", [])
      E:\Programme\Laravel Lab\blog\vendor\laravel\framework\src\Illuminate\Database\Connectors\Connector.php:68

  Please use the argument -v to see more details.

标签: laravellaravel-5.6

解决方案


首先你需要启动你的mysql服务器然后检查你的mysql的env配置,我认为你的密码不是root,但是你把root输入密码。有时密码为空。请检查一下。


推荐阅读