无法在Heroku上托管Go后端

mkshixfv  于 2022-11-13  发布在  Go
关注(0)|答案(1)|浏览(134)

我有一个go应用程序,我想在Heroku上托管。这是在我的proc文件中:

web: studentData

我正在尝试主持此项目:https://github.com/ArjunMalhotra07/studentData
以下是日志:

2022-10-21T08:47:14.341704+00:00 heroku[web.1]: State changed from crashed to starting
2022-10-21T08:47:15.169264+00:00 heroku[web.1]: Starting process with command `studentData`
2022-10-21T08:47:16.764117+00:00 app[web.1]: 2022/10/21 08:47:16 dial tcp 127.0.0.1:3306: connect: connection refused
2022-10-21T08:47:16.955065+00:00 heroku[web.1]: Process exited with status 1
2022-10-21T08:47:17.025025+00:00 heroku[web.1]: State changed from starting to crashed
2022-10-21T11:44:18.962122+00:00 heroku[web.1]: State changed from crashed to starting
2022-10-21T11:44:19.657482+00:00 heroku[web.1]: Starting process with command `studentData`
2022-10-21T11:44:21.125150+00:00 app[web.1]: 2022/10/21 11:44:21 dial tcp 127.0.0.1:3306: connect: connection refused
2022-10-21T11:44:21.306577+00:00 heroku[web.1]: Process exited with status 1
2022-10-21T11:44:21.749452+00:00 heroku[web.1]: State changed from starting to crashed
2022-10-21T12:25:14.309144+00:00 heroku[web.1]: State changed from crashed to starting
2022-10-21T12:25:15.245316+00:00 heroku[web.1]: Starting process with command `studentData`
2022-10-21T12:25:16.869878+00:00 app[web.1]: 2022/10/21 12:25:16 dial tcp 127.0.0.1:3306: connect: connection refused
2022-10-21T12:25:17.061078+00:00 heroku[web.1]: Process exited with status 1
2022-10-21T12:25:17.121535+00:00 heroku[web.1]: State changed from starting to crashed
2022-10-21T13:47:36.216585+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/" host=student-data-go.herokuapp.com request_id=dff4bc20-5ba3-40e9-b70e-be468298c454 fwd="103.217.117.139" dyno= connect= service= status=503 bytes= protocol=https
2022-10-21T13:47:36.923361+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/favicon.ico" host=student-data-go.herokuapp.com request_id=f33ae591-8ee3-434b-999c-7a66c273fb77 fwd="103.217.117.139" dyno= connect= service= status=503 bytes= protocol=https

我看不出出出了什么问题。
请让我知道,如果有任何其他需要说明,以获得问题的根源

vwoqyblh

vwoqyblh1#

请检查您与MySql的连接。错误明确指出连接到数据库时出现问题。在您的github repo中,我发现了以下内容:
如果您有任何问题,请与我们联系。
您应该将127.0.0.1(localhost)更改为指向生产数据库主机的某个env变量。

相关问题