【发布时间】:2018-03-06 13:23:27
【问题描述】:
我从名为 laravel 的 Laravel 5.4 数据库中删除了 migrations 表。当我运行php artisan migrate:install 时,我收到此错误:
[Illuminate\Database\QueryException]
SQLSTATE[HY000] [2002] No such file or directory
(SQL: select * from information_schema.tables where table_schema = laravel
and table_name = migrations)
我删除并重新创建了数据库。我还跑了composer update。没有运气。我可以在 phpMyAdmin 中运行命令并手动创建表。
这个问题有时也会出现类似的 2002 错误:
[Illuminate\Database\QueryException]
SQLSTATE[HY000] [2002] php_network_getaddresses: getaddrinfo failed: No such host is known.
(SQL: select * from information_schema.tables where table_schema = laravel
and table_name = migrations and table_type = 'BASE TABLE')
[Illuminate\Database\QueryException]
SQLSTATE[HY000] [2002] php_network_getaddresses: getaddrinfo failed: Name or service not known
(SQL: select * from information_schema.tables where table_schema = laravel
and table_name = migrations and table_type = 'BASE TABLE')
【问题讨论】:
标签: php mysql laravel laravel-artisan