【发布时间】:2021-03-03 16:29:37
【问题描述】:
我无法在 Laravel 中使用 php artisan migrate 进行迁移
我正在使用 Xampp 在本地工作,并且我已经创建了数据库(回收)。
这是我的 .env 文件
DB_CONNECTION=mysql
DB_HOST=localhost
DB_PORT=3306
DB_DATABASE=recycling
DB_USERNAME=root
DB_PASSWORD=
在终端中,当我使用 php artisan migrate 时,我得到了这个:
SQLSTATE[HY000] [2002] No such file or directory (SQL: select * from information_schema.tables where table_schema = recycling and table_name = migrations and table_type = 'BASE TABLE')
有什么想法吗?
【问题讨论】:
-
您是否创建了一个名为
recycling的数据库? -
是的,我愿意。 cmd + c , cmd+ v 不要写错了
-
您是否尝试将
localhost替换为127.0.0.1? -
它们都不起作用