【问题标题】:Could not find driver while migrating迁移时找不到驱动程序
【发布时间】:2018-09-04 20:54:47
【问题描述】:

我想通过 php artisan migrate 进行迁移,但出现错误:

In Connection.php line 664:

  could not find driver (SQL: select * from information_schema.tables where table_schema = laravel and table_name = migrations)

In Connector.php line 67:
  could not find driver

我的环境文件设置:

DB_CONNECTION=mysql
DB_HOST=127.0.0.1
DB_PORT=3306
DB_DATABASE=laravel
DB_USERNAME=root
DB_PASSWORD=

【问题讨论】:

  • 尝试清除缓存,触发命令php artisan config:cache
  • 是否安装了 PDO?检查您的 PHP CLI 配置。
  • 是的,PDO 已经安装好了,我在没有 laravel 的情况下使用了很多次
  • 确保也为 CLI 安装了它。做php -i | grep -i pdo。命令行和浏览器的配置可能不同。
  • 你可以尝试将端口更改为 33060 吗?

标签: php mysql laravel migration


【解决方案1】:

你需要安装php-mysql驱动。

【讨论】:

    猜你喜欢
    • 2019-01-27
    • 2018-03-26
    • 2023-04-01
    • 1970-01-01
    • 1970-01-01
    • 2015-05-20
    • 2018-08-15
    • 2019-05-17
    • 1970-01-01
    相关资源
    最近更新 更多