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'
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!
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.
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:
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
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.