运行迁移时“没有这样的文件或目录”或“没有这样的主机是已知的”
2022-08-30 13:00:16
我从名为 的Laravel 5.4数据库中删除了该表。当我运行时,我得到这个错误:migrations
laravel
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)
我删除并重新创建了数据库。我也跑了.没有运气。我可以在phpMyAdmin中运行该命令并手动创建表。composer update
此问题有时也会表现为类似的 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')