查询工作正常,但迁移
我正在使用 Laravel 9 / Laravel Sail < / strong>进行一个小型项目。我有一个奇怪的错误。我的应用程序查询效果很好,可以使用雄辩选择,更新,插入,插入,也可以使用雄辩。一切都很好。
现在,我尝试创建一个新的迁移,并尝试使用通常的php Arisan Migrate
我收到一个错误消息:
SQLSTATE[HY000] [2002] php_network_getaddresses: getaddrinfo for mysql failed: Temporary failure in name resolution (SQL: select * from information_schema.tables where table_schema = project and table_name = migrations and table_type = 'BASE TABLE')
但是通过应用程序,它可以正常连接到数据库,因为插入和选择,更新
问题就是我尝试迁移时,这很奇怪。
我的环境:
DB_CONNECTION=mysql
DB_HOST=mysql
DB_PORT=3306
DB_DATABASE=project
DB_USERNAME=username
DB_PASSWORD=password
I'm working on a small project using Laravel 9 / Laravel Sail. I have a weird error. my application queries works fine I can select, update, insert with no problem using Eloquent also. Everything is good.
Now I try to created a new migration and I try to push the migration using the usual php arisan migrate
I'm getting an error message :
SQLSTATE[HY000] [2002] php_network_getaddresses: getaddrinfo for mysql failed: Temporary failure in name resolution (SQL: select * from information_schema.tables where table_schema = project and table_name = migrations and table_type = 'BASE TABLE')
But by application works fine its connected to the database as I'm inserting and selecting, updating
the problem is just when I try to migrate which is weird.
my env :
DB_CONNECTION=mysql
DB_HOST=mysql
DB_PORT=3306
DB_DATABASE=project
DB_USERNAME=username
DB_PASSWORD=password
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
如果您使用的是Laravel帆,则应该运行:
而不是:
If you're using Laravel Sail, you should run:
instead of:
此命令将帮助您,清除缓存的配置
this command will help you, clear the cached config