如何在 Laravel 中的 Heroku Cloud 数据库(ClearDB)上运行迁移

发布于 2025-01-10 01:55:52 字数 937 浏览 1 评论 0原文

我在 Heroku 上面临数据库迁移问题。我尝试在 Heroku 上使用clearDB 来部署带有 mysql 数据库的 laravel 项目。我已经在heroku上成功部署了我的网络应用程序,它在没有与数据库交互的页面上工作正常,但问题是与数据库交互的页面会出现500服务器错误。所以我认为这是数据库的问题,因为我没有' 尝试在Heroku CLI 上运行迁移,

heroku run php artisan migrate --app <app Name>

t 运行迁移,但我已经在heroku Config Vars 上放置了clearDB 的Config Vars 值。因此,我在前两次运行此命令时

SQLSTATE[HY000] [2002] Connection refused (SQL: select * from information_schema.tables where table_schem  a = forge and table_name = migrations and table_type = 'BASE TABLE') 

SQLSTATE[HY000] [2002] Connection refused 

它显示错误错误图片

我一直在尝试迁移它,但之后我收到了这个我无权访问的错误一个应用程序。

Error: You do not have access to the app laravel-test-demo.

错误 ID:禁止 但我已经登录了heroku cli 第二个错误

I'm facing a problem on databases migration on Heroku .Im trying to deploy my laravel project with mysql databases using clearDB on Heroku. I have deploy my web app successfully on heroku it work fine on pages that has no interaction with databases but the problem is the pages that have interaction with databases would get 500 server error.So it is the problem with databases I think because I haven't run migration but I have already put Config Vars value for clearDB on heroku Config Vars.So I have tried to run migration on Heroku CLI

heroku run php artisan migrate --app <app Name>

the first two time I run this command Its show an error

SQLSTATE[HY000] [2002] Connection refused (SQL: select * from information_schema.tables where table_schem  a = forge and table_name = migrations and table_type = 'BASE TABLE') 

SQLSTATE[HY000] [2002] Connection refused 

pic for error

I keep trying to migrate it but after that I got this error that I dont have access to an app.

Error: You do not have access to the app laravel-test-demo.

Error ID: forbidden
but I have already login in heroku cli
second error

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文