# ECONNREFUSED 127.0.0.1:3306 when using fly.io

**URL:** <https://forum.ghost.org/t/econnrefused-127-0-0-1-3306-when-using-fly-io/32931>\
**Category:** Self-hosting\
**Created:** [September 21, 2022, 3:34pm UTC](https://forum.ghost.org/t/econnrefused-127-0-0-1-3306-when-using-fly-io/32931 "2022-09-21T15:34:04Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![patghost](https://sea1.discourse-cdn.com/flex015/user_avatar/forum.ghost.org/patghost/32/4859_2.png) [@patghost](https://forum.ghost.org/u/patghost)\
**Post date:** [September 21, 2022, 3:34pm UTC](https://forum.ghost.org/t/econnrefused-127-0-0-1-3306-when-using-fly-io/32931/1 "2022-09-21T15:34:04Z")

</div>

Ghost has had a breaking chance with a switch from sqlite3 to MySQL by default

I’m trying to get a totally new build to work but keep getting “ECONNREFUSED 127.0.0.1:3306”

Should anyone have been able to make Ghost work with MySQL in [fly.io](http://fly.io), I’d appreciate to understand your setup.

---

<div class="post-metadata">

**Author:** ![mjw](https://sea1.discourse-cdn.com/flex015/user_avatar/forum.ghost.org/mjw/32/30781_2.png) [@mjw](https://forum.ghost.org/u/mjw)\
**Post date:** [September 21, 2022, 10:17pm UTC](https://forum.ghost.org/t/econnrefused-127-0-0-1-3306-when-using-fly-io/32931/2 "2022-09-21T22:17:42Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![patghost](https://sea1.discourse-cdn.com/flex015/user_avatar/forum.ghost.org/patghost/32/4859_2.png) [@patghost](https://forum.ghost.org/u/patghost)\
**Post date:** [September 22, 2022, 9:03am UTC](https://forum.ghost.org/t/econnrefused-127-0-0-1-3306-when-using-fly-io/32931/3 "2022-09-22T09:03:39Z")

</div>

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](http://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](http://fly.io)’s (free tier) is no longer an option

---

<div class="post-metadata">

**Author:** ![mjw](https://sea1.discourse-cdn.com/flex015/user_avatar/forum.ghost.org/mjw/32/30781_2.png) [@mjw](https://forum.ghost.org/u/mjw)\
**Post date:** [September 22, 2022, 11:39am UTC](https://forum.ghost.org/t/econnrefused-127-0-0-1-3306-when-using-fly-io/32931/4 "2022-09-22T11:39:57Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![snhou](https://sea1.discourse-cdn.com/flex015/user_avatar/forum.ghost.org/snhou/32/21837_2.png) [@snhou](https://forum.ghost.org/u/snhou)\
**Post date:** [January 13, 2023, 10:22pm UTC](https://forum.ghost.org/t/econnrefused-127-0-0-1-3306-when-using-fly-io/32931/5 "2023-01-13T22:22:38Z")

</div>

if you still wish to run SQLite in Ghost 5,  
add to fly.toml

```auto
[env]
  database__client = "sqlite3"
  database __connection__ filename = "/var/lib/ghost/content/data/ghost.db"

```
