Question

✖ Setting up "ghost" mysql user fails + droplet

Ghost installation fails the mysql setup

i tried 5+ times, always same.

any idea? thank you!

✖ Setting up “ghost” mysql user


✔ Checking system Node.js version - found v18.17.1

✔ Checking current folder permissions

✔ Checking memory availability

✔ Checking free space

✔ Checking for latest Ghost version

✔ Setting up install directory

✔ Downloading and installing Ghost v5.85.1

✔ Finishing install process

? **Enter your blog URL:** https://mydomain.com

✔ Configuring Ghost

✔ Setting up instance

+ sudo useradd --system --user-group ghost

+ sudo chown -R ghost:ghost /var/www/ghost/content

✔ Setting up "ghost" system user

**✖ Setting up "ghost" mysql user**

+ sudo mv /tmp/mydomain-com/mydomain.com.conf /etc/nginx/sites-available/mydomain.com.conf

+ sudo ln -sf /etc/nginx/sites-available/mydomain.com.conf /etc/nginx/sites-enabled/mydomain.com.conf

+ sudo nginx -s reload

✔ Setting up Nginx

? **Enter your email (For SSL Certificate)** hello@mydomain.com

+ sudo mkdir -p /etc/letsencrypt

+ sudo ./acme.sh --install --home /etc/letsencrypt

+ sudo /etc/letsencrypt/acme.sh --issue --home /etc/letsencrypt --server letsencrypt --domain mydomain.com --webroot /var/www/ghost/system/nginx-root --reloadcmd "nginx -s reload" --accountemail hello@mydomain.com --keylength 2048

+ sudo openssl dhparam -dsaparam -out /etc/nginx/snippets/dhparam.pem 2048

+ sudo mv /tmp/ssl-params.conf /etc/nginx/snippets/ssl-params.conf

+ sudo mv /tmp/mydomain-com/mydomain.com-ssl.conf /etc/nginx/sites-available/mydomain.com-ssl.conf

+ sudo ln -sf /etc/nginx/sites-available/mydomain.com-ssl.conf /etc/nginx/sites-enabled/mydomain.com-ssl.conf

+ sudo nginx -s reload

✔ Setting up SSL

+ sudo mv /tmp/mydomain-com/ghost_mydomain-com.service /lib/systemd/system/ghost_mydomain-com.service

+ sudo systemctl daemon-reload

✔ Setting up Systemd

+ sudo systemctl is-active ghost_mydomain-com

+ sudo systemctl start ghost_mydomain-com

+ sudo systemctl stop ghost_mydomain-com

✖ Starting Ghost

One or more errors occurred.



1) ConfigError



Error detected in the production configuration.



Message: connect ECONNREFUSED 127.0.0.1:3306

Configuration Key(s): database.connection.host / database.connection.port

Current Value(s): 127.0.0.1 / 3306



Help: Ensure that MySQL is installed and reachable. You can always re-run `ghost setup` to try again.





2) GhostError



Message: Ghost was able to start, but errored during boot with: connect ECONNREFUSED 127.0.0.1:3306

Help: Unknown database error

Suggestion: journalctl -u ghost_mydomain-com -n 50



Debug Information:

    OS: Ubuntu, v22.04.3 LTS

    Node Version: v18.17.1

    Ghost Version: 5.85.1

    Ghost-CLI Version: 1.26.0

    Environment: production

    Command: 'ghost install --auto --db=mysql --dbhost=127.0.0.1 --dbport=3306 --dbname=ghost_production --dbuser=root --dbpass=888b26c6f701b879877afbe3c89d31b9cc06ac90ff58f346 --dir=/var/www/ghost --start'

Submit an answer


This textbox defaults to using Markdown to format your answer.

You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

Sign In or Sign Up to Answer

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

KFSys
Site Moderator
Site Moderator badge
June 17, 2024

Heya,

I’ve just tested the same image with the lowest Droplet and I was able to reproduce the issue. I believe the smallest Droplet is not a good fit for that and would recommend you to try with a larger one.

Bobby Iliev
Site Moderator
Site Moderator badge
June 16, 2024

Hey!

This is indeed quite strange, it sounds like MySQL is failing to start, this could be due to the server resources.

What is the size of the Droplet that you are using to deploy this? Also what type of CPU are you using?

I’ve tested this just now with a 1GB RAM Droplet and it failed with:

✖ Checking memory availability
One or more errors occurred.

1) SystemError

So this could explain why your MySQL instance was failing as it would not have enough memory to run properly.

But the I also tested this with 2GB RAM Droplet seems to have worked as expected. Can you give this a try with a larger Droplet?

If you still get that error, can you share the output of the journalctl -u ghost_mydomain-com -n 50 command?

- Bobby

Try DigitalOcean for free

Click below to sign up and get $200 of credit to try our products over 60 days!

Sign up

Featured on Community

Get our biweekly newsletter

Sign up for Infrastructure as a Newsletter.

Hollie's Hub for Good

Working on improving health and education, reducing inequality, and spurring economic growth? We'd like to help.

Become a contributor

Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.

Welcome to the developer cloud

DigitalOcean makes it simple to launch in the cloud and scale up as you grow — whether you're running one virtual machine or ten thousand.

Learn more
DigitalOcean Cloud Control Panel