【发布时间】:2020-06-30 22:33:51
【问题描述】:
我已经阅读了很多关于工匠移民问题的帖子,但不幸的是,这些帖子都不适用于我的情况。
所以我通过 Vagrant 运行 Laravel Homestead,并在 Vagrant VM 中创建了一个新数据库。
在我的 Ubuntu 桌面上,我可以通过 DBeaver 连接到数据库,它会显示数据库。因为我在 Vagrant VM 中运行数据库,所以我通过 192.168.10.10(在 Homestead.yaml 文件中指定)而不是 localhost(127.0.0.1)连接到它。到目前为止一切顺利。
我通过运行以下命令创建了一个迁移文件:php artisan make:migration create_todo_table。但是,当我运行 php artisan migrate 时,出现以下异常错误:
Illuminate\Database\QueryException
Could not find driver (SQL: select * from information_schema.tables where table_schema = homestead and table_name = migrations and table_type = 'BASE TABLE')
我的.env文件中关于数据库的数据如下:
DB_CONNECTION=mysql
DB_HOST=192.168.10.10
DB_PORT=3306
DB_DATABASE=homestead
DB_USERNAME=homestead
DB_PASSWORD=secret
我曾尝试通过运行php artisan config:cache 来清除缓存,但没有成功。
有人能给我一些见解吗?
【问题讨论】:
标签: php mysql laravel vagrant homestead