我从名为laravel
的Laravel5.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')
https://stackoverflow.com/questions/46407490
复制相似问题