php - 无法使用 000webhost 在 Laravel 中迁移

标签 php mysql laravel

我在本地有我的应用程序,但我在 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/

相关文章:

mysql - 在数据库设计中如何避免循环引用?

mysql - (MYSQL) 检查 ID 是否已存在的性能(例如在投票选民表中)

Laravel 7 Socialite Google 登录显示 Invalid Grant 错误

laravel - Gulp-concat:将所有js包装在一个唯一的$(document)中

php - 升序排列数组键

php - onFinish 时获取 Shadowbox 内的图像 URL?

php - mysql只获取一个字段

mysql - 如何在Mysql存储过程中查找列表中的重复/重复值?

php - 十月 CMS - 如何正确路由

php - 设置测试服务器简介