# Latest Ghost Update Throws "Unknown database error"

**URL:** <https://forum.ghost.org/t/latest-ghost-update-throws-unknown-database-error/42845>\
**Category:** Self-hosting\
**Created:** [November 20, 2023, 12:36pm UTC](https://forum.ghost.org/t/latest-ghost-update-throws-unknown-database-error/42845 "2023-11-20T12:36:52Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![sgrobert](https://sea1.discourse-cdn.com/flex015/user_avatar/forum.ghost.org/sgrobert/32/12412_2.png) [@sgrobert](https://forum.ghost.org/u/sgrobert)\
**Post date:** [November 20, 2023, 12:36pm UTC](https://forum.ghost.org/t/latest-ghost-update-throws-unknown-database-error/42845/1 "2023-11-20T12:36:52Z")

</div>

To whom it may concern,

I have recently tried to update my `Ghost` installation to `v5.74.0`, but ended up with an `Unknown database error`, which has been occurring since `v5.72.0` and I did not have the time to take a deep dive into the issue.

I have just restarted a fresh installation of the server and the error still persists. Hope someone will be able to assist on the issue.

* * *

## **Attempt 1: Fresh Installation With Latest**

- Error Thrown: Message: Ghost was able to start, but errored during boot with: connect ECONNREFUSED ::1:3306  
Help: Unknown database error

```auto
✔ Checking system Node.js version - found v18.18.2
✔ Ensuring user is not logged in as ghost user
✔ Checking if logged in user is directory owner
✔ Checking current folder permissions
+ sudo systemctl is-active ghost_therobexperiment-com
✔ Validating config
✔ Checking folder permissions
✔ Checking file permissions
✔ Checking content folder ownership
✔ Checking memory availability
✔ Checking binary dependencies
✔ Checking systemd unit file
✔ Checking systemd node version - found v18.18.2
+ sudo systemctl start ghost_therobexperiment-com
+ sudo systemctl stop ghost_therobexperiment-com
✖ Starting Ghost: therobexperiment-com
A GhostError occurred.

Message: Ghost was able to start, but errored during boot with: connect ECONNREFUSED ::1:3306
Help: Unknown database error
Suggestion: journalctl -u ghost_therobexperiment-com -n 50

Debug Information:
    OS: Ubuntu, v22.04.3 LTS
    Node Version: v18.18.2
    Ghost Version: 5.74.0
    Ghost-CLI Version: 1.25.3
    Environment: production
    Command: 'ghost start'

```

* * *

## **Attempt 2: Changed “localhost” to "127.0.0.1**

- Based on recommendations from: [Update to latest version failed connect ECONNREFUSED ::1:3306 - #2 by vikaspotluri123](https://forum.ghost.org/t/update-to-latest-version-failed-connect-econnrefused-3306/42324/2)
- New Error: Message: Ghost was able to start, but errored during boot with: Access denied for user ‘ghost\_user’@‘localhost’ (using password: YES)  
Help: Unknown database error

```auto
✔ Checking system Node.js version - found v18.18.2
✔ Ensuring user is not logged in as ghost user
✔ Checking if logged in user is directory owner
✔ Checking current folder permissions
+ sudo systemctl is-active ghost_mywebsite-com
✔ Validating config
✔ Checking folder permissions
✔ Checking file permissions
✔ Checking content folder ownership
✔ Checking memory availability
✔ Checking binary dependencies
✔ Checking systemd unit file
✔ Checking systemd node version - found v18.18.2
+ sudo systemctl start ghost_mywebsite-com
+ sudo systemctl stop ghost_mywebsite-com
✖ Starting Ghost: mywebsite-com
A GhostError occurred.

Message: Ghost was able to start, but errored during boot with: Access denied for user 'ghost_user'@'localhost' (using password: YES)
Help: Unknown database error
Suggestion: journalctl -u ghost_mywebsite-com -n 50

Debug Information:
    OS: Ubuntu, v22.04.3 LTS
    Node Version: v18.18.2
    Ghost Version: 5.74.0
    Ghost-CLI Version: 1.25.3
    Environment: production
    Command: 'ghost start'

```

* * *

Currently I have no other solution to get out of the above. Hope someone can assist me on a potential solution for the latest installation update.

Thank you.

---

<div class="post-metadata">

**Author:** ![Kevin](https://sea1.discourse-cdn.com/flex015/user_avatar/forum.ghost.org/kevin/32/32_2.png) [@Kevin](https://forum.ghost.org/u/Kevin)\
**Post date:** [November 20, 2023, 12:46pm UTC](https://forum.ghost.org/t/latest-ghost-update-throws-unknown-database-error/42845/2 "2023-11-20T12:46:46Z")

</div>

Seems like you have a mysql config/permissions issue due to the change from `localhost` to `127.0.0.1`. A quick google of your issue showed these

> <https://stackoverflow.com/questions/47242111/mysql-able-to-connect-to-localhost-but-not-to-127-0-0-1>

> <https://serverfault.com/questions/295285/mysql-cannot-connect-via-localhost-only-127-0-0-1>

> <https://serverfault.com/questions/971506/mysql-connects-to-localhost-but-not-127-0-0-1>

---

<div class="post-metadata">

**Author:** ![sgrobert](https://sea1.discourse-cdn.com/flex015/user_avatar/forum.ghost.org/sgrobert/32/12412_2.png) [@sgrobert](https://forum.ghost.org/u/sgrobert)\
**Post date:** [November 20, 2023, 12:54pm UTC](https://forum.ghost.org/t/latest-ghost-update-throws-unknown-database-error/42845/3 "2023-11-20T12:54:14Z")

</div>

Hi @Kevin,

Is there potentially any direct solution that I may implement as I am definitely not an expert in the `Ghost config setup` and my recent attempts is just trying out different solutions I have seen from the forum.

Should I then revert my settings back to `localhost`? But if so, are there any alternative solutions to resolving the default issues with the database error?

I’m also a bit curious as to why this may be happening as without the recent upgrades to `Node v18`, every upgrade seems to work fine.

Hope you may help give some better context of the situation and hopefully any potential direct solution which I can implement.

Thank you.

---

<div class="post-metadata">

**Author:** ![Kevin](https://sea1.discourse-cdn.com/flex015/user_avatar/forum.ghost.org/kevin/32/32_2.png) [@Kevin](https://forum.ghost.org/u/Kevin)\
**Post date:** [November 20, 2023, 2:40pm UTC](https://forum.ghost.org/t/latest-ghost-update-throws-unknown-database-error/42845/4 "2023-11-20T14:40:21Z")

</div>

It’s more mysql config/mysql user privileges than Ghost config. Do you have a server admin who can handle it for you?

> Should I then revert my settings back to `localhost` ? But if so, are there any alternative solutions to resolving the default issues with the database error?

You can but you’d be back at the original error, to fix that you’d need to adjust your mysql config so it listens on the ipv6 interface. An alternative could be setting a global `export NODE_OPTIONS=--dns-result-order=ipv4first` for the user that your Ghost instance runs as.

> I’m also a bit curious as to why this may be happening as without the recent upgrades to `Node v18` , every upgrade seems to work fine.

Node 18 is a major release so can contain breaking changes. In this case it changed its behaviour to favour the DNS result order that the resolver provides rather than always forcing ipv4 to be first, that’s why it now resolves `localhost` to the ipv6 `::1` instead of the ipv4 `127.0.0.1`

---

<div class="post-metadata">

**Author:** ![sgrobert](https://sea1.discourse-cdn.com/flex015/user_avatar/forum.ghost.org/sgrobert/32/12412_2.png) [@sgrobert](https://forum.ghost.org/u/sgrobert)\
**Post date:** [November 20, 2023, 10:00pm UTC](https://forum.ghost.org/t/latest-ghost-update-throws-unknown-database-error/42845/5 "2023-11-20T22:00:50Z")

</div>

Hi @Kevin,

Thanks for sharing the context around the `ipv4` vs `ipv6` issues.

Given such, the conversion from `localhost` to `127.0.0.1` sounds inevitable and a simpler solution to resolve the `first issue.

However, my main worry is definitely dabbling too much into the `mysql config/mysql user privileges`, as previously I had to do a hard reset in my last `fresh install` about 1 year ago mainly due to the `mysql config/mysql user privileges`, which was advised here: [New Ghost v5.41.0 Unable To Connect To MySQL Database - #7 by sgrobert](https://forum.ghost.org/t/new-ghost-v5-41-0-unable-to-connect-to-mysql-database/37518/7)

* * *

Are there any direct `mysql` config example steps that you can help provide that I may execute as well, I do worry about resetting the wrong config, and I have to do everything all over again, as I am quite unsure about the `mysql config/mysql user privileges` that you are referring to as the current issue.

Do I need to provide any other details to assist you with this?

---

<div class="post-metadata">

**Author:** ![mheland](https://sea1.discourse-cdn.com/flex015/user_avatar/forum.ghost.org/mheland/32/26236_2.png) [@mheland](https://forum.ghost.org/u/mheland)\
**Post date:** [November 20, 2023, 10:34pm UTC](https://forum.ghost.org/t/latest-ghost-update-throws-unknown-database-error/42845/6 "2023-11-20T22:34:08Z")

</div>

> [@sgrobert](#):
>
> `: connect ECONNREFUSED ::1:3306`

Hi @sgrobert I assume you are running Ghost on a VPS? Have you considered running Ghost and MySQL as docker containers? It solves a lot of frustrating stuff, the kind that you are experiencing.

I wrote a guide for Hetzner Cloud on arm64 platform, but it should be fine on any VPS.

I’d be happy to walk you through it, DM.

> **[How to install and configure Ghost CMS on Debian](https://community.hetzner.com/tutorials/ghost-cms-on-arm64-debian/)**
>
> This tutorial describes how to install and configure Ghost CMS on Debian using Docker

---

<div class="post-metadata">

**Author:** ![sgrobert](https://sea1.discourse-cdn.com/flex015/user_avatar/forum.ghost.org/sgrobert/32/12412_2.png) [@sgrobert](https://forum.ghost.org/u/sgrobert)\
**Post date:** [November 22, 2023, 12:39am UTC](https://forum.ghost.org/t/latest-ghost-update-throws-unknown-database-error/42845/7 "2023-11-22T00:39:22Z")

</div>

Hi @mheland ,

Thank you for the suggestions.

I was exposed to that option previously but I have some custom config for media storage, so this docker path might be more extensive work, especially if I do need to keep the image manually updated every time there is a release.

Though I totally get the benefits of the docker setup as well.

So I sincerely hope to utilize the traditional method, but it is mainly the config that I need to get past, and sincerely hope to get assistance specifically for that.

Thank you for the suggestion though.

---

<div class="post-metadata">

**Author:** ![sgrobert](https://sea1.discourse-cdn.com/flex015/user_avatar/forum.ghost.org/sgrobert/32/12412_2.png) [@sgrobert](https://forum.ghost.org/u/sgrobert)\
**Post date:** [November 25, 2023, 12:38pm UTC](https://forum.ghost.org/t/latest-ghost-update-throws-unknown-database-error/42845/8 "2023-11-25T12:38:50Z")

</div>

> [@mheland](#):
>
> [How to install and configure Ghost CMS on Debian](https://community.hetzner.com/tutorials/ghost-cms-on-arm64-debian/)

Hi @Kevin,

I have just found a solution.

Basically, I re-installed a brand new server installation following strictly to the instructions in [How to install & setup Ghost on Ubuntu 20.04 or 22.04](https://ghost.org/docs/install/ubuntu/) (The official Ghost-Ubuntu Installation Guide).

All in all, I guess my issue was the manual change from `localhost` to `127.0.0.1` did not work and a fresh installation clears up the issue altogether noting that the usual `localhost` placeholders will now be switched over to `127.0.0.1` to resolve the issue while using `node 18 and above`.

In addition, do ensure that the server instance being used is running on `ipv6` as well.

Hope this helps someone else facing the same issue! Cheers! ;)

```auto

OS: Ubuntu, v22.04.3 LTS
Node Version: v18.18.2
Ghost Version: 5.74.1
Ghost-CLI Version: 1.25.3
Environment: production

```
