The error message indicates that the connection to MySQL is refused. Most likely a permissions issue, but difficult to say since you haven’t described your setup is any detail.
Thanks for commenting. For the sake of others
MySQL is not part of Ghost’s docker image, so you need to install it separately, when doing that you realize the real issue: MySQl8 needs a lot more RAM than fly.io offers and what most hosting platforms offer. Bare minimum one seemingly needs 2GB RAM. PS: PlanetScale was also never an option
Conclusion: Hosting Ghost on fly.io’s (free tier) is no longer an option
Ghost recommend a minimum of 1 GB (you may want to amend your post’s reference to MB), but I find 2 GB more realistic unless you are prepared to optimize your host.