【问题标题】:I typed 'php artisan migrate' in cmd then it shows me error我在 cmd 中输入了“php artisan migrate”,然后它显示错误
【发布时间】:2020-08-04 21:28:31
【问题描述】:

照亮\数据库\查询异常

找不到驱动程序(SQL:select * from information_schema.tables where table_schema = cvs and table_name = migrations and table_type = 'BASE TABLE')

在 C:\xampp\htdocs\cvs\vendor\laravel\framework\src\Illuminate\Database\Connection.php:671 667| // 如果尝试运行查询时发生异常,我们将格式化错误 668| // 包含与 SQL 的绑定的消息,这将使该异常成为 669| // 对开发人员更有帮助,而不仅仅是数据库的错误。 670| ``` 捕获(异常 $e){

671|抛出新的查询异常( 672| $query, $this->prepareBindings($bindings), $e 673| ); 674| }``` 675|

1 C:\xampp\htdocs\cvs\vendor\laravel\framework\src\Illuminate\Database\Connectors\Connector.php:70 PDOException::("找不到驱动程序")

2 C:\xampp\htdocs\cvs\vendor\laravel\framework\src\Illuminate\Database\Connectors\Connector.php:70 PDO::__construct()

【问题讨论】:

  • 检查您的 .env 文件。它有正确的凭据吗?

标签: php laravel


【解决方案1】:

你在 php.ini 文件中启用了 php_mysqli 吗?

在 php.ini 文件中查找这一行并确保它没有被注释。

extension=php_mysqli.so

【讨论】:

    【解决方案2】:

    DB_USERNAME、DB_PASSWORD 凭据错误通常是问题。

    还需要验证bd引擎驱动是否被激活。

    PDO MySQL Driver

    phpinfo() output

    【讨论】:

      猜你喜欢
      • 2018-05-31
      • 1970-01-01
      • 2018-11-18
      • 1970-01-01
      • 2020-03-21
      • 2020-11-27
      • 2016-05-14
      • 2015-12-19
      • 2020-10-23
      相关资源
      最近更新 更多