Skip to content

Conversation

@BertanT
Copy link
Contributor

@BertanT BertanT commented Feb 18, 2024

As described on this forum post on the Ghost Forum, having the database hostname set to the current default of localhost in config.production.json results in the hostname being resolved to an IPV6 address when connecting to the database in Node 18, as opposed to IPV4 resolution in Node 16.

Since the upgrade to Node 18, this issue causes sites created with ghost install to throw ECONNREFUSED ::1:3306 when trying to start Ghost, as well as to prevent ghost install and ghost setup from successfully creating the ghost MySQL user. Though the current workaround of setting the database hostname in config.production.json as 127.0.0.1 to force Node to use IPV4 and re-running ghost setup works fine, I believe it would be better for this to be the new default behavior.

I really hope I this little change will be helpful, and thank you for keeping up the great work on Ghost!😌

@daniellockyer daniellockyer merged commit 526d080 into TryGhost:main Mar 19, 2024
@daniellockyer
Copy link
Contributor

Thanks @BertanT! 🙂

@BertanT BertanT deleted the fix-default-sql-hostname branch March 27, 2024 15:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants