我在本地有我的应用程序,但我在 config\中配置了我的 .env 和 database.php 以连接到远程托管在 000webhost 中的数据库,但每当我执行 php artisan migrate
时我都会收到消息
SQLSTATE[HY000] [2002] Established connection failed because connected host has failed to respond.
或者我是否需要在线托管我的应用程序才能运行?帮助。
最佳答案
我怀疑您使用的是 000webhost 的免费计划,该计划不支持远程 MySQL 连接。他们的paid accounts do :
How can I connect to MySQL from my computer?
Remote MySQL connections are disabled for security and server performance reasons.
However remote MySQL connections will be enabled if you upgrade your account
关于php - 无法使用 000webhost 在 Laravel 中迁移,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/39190954/