Need help to diagnose MYSQL database issue in updating to Ghost v4, multiblog

Summary of issue:
I’m trying to update to Ghost v4. I first ran ghost update v3 to try to update to the latest v3 version. Then MySQL database appears to be down right now, but I don’t really know where to look for the problem (I have little experience)

If you aren’t running the latest version of Ghost, the first thing we will ask you to do is update to the latest version of Ghost.

  • What’s your URL? [completed] (in addition, portfolio is on the same droplet and is also not accessible via web browser, comes up with 502 bad gateway
    When I run ghost ls, blog is not running and portfolio is running)
  • What version of Ghost are you using? If it’s not the latest, please update Ghost first before opening your topic. I am stuck on 3.42.3 for my blog

- How was Ghost installed and configured?
I have a multisite setup. The first blog was installed with the Digital Ocean one-click install and the second blog was installed following this site Set-up Multiple Ghost Blogs on One Digital Ocean Droplet I am trying to update the second blog.

- What Node version, database, OS & browser are you using?

OS: Ubuntu, v18.04.4 LTS
    Node Version: v12.18.0
    Ghost Version: 3.42.3
    Ghost-CLI Version: 1.16.3
    Environment: production

Database version I am not sure how to check, as when I run mysql from the folder where ghost is, I have this error

ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2)

I am using Safari for web browser

- What errors or information do you see in the console?

Errors when I run ghost doctor:

Local MySQL install was not found or is stopped. You can ignore this if you are using a remote MySQL host.
Alternatively you could:
a) install/start MySQL locally
b) run `ghost install --db=sqlite3` to use sqlite
c) run `ghost install local` to get a development install using sqlite3.
? Continue anyway? No
✖ Checking for a MySQL installation

...

One or more errors occurred.

1) Checking for a MySQL installation

Message: MySQL check failed.

Errors when I run ghost update:

✖ Updating to a major version
An error occurred.
Message: 'connect ECONNREFUSED 127.0.0.1:3306'

If I try to run any commands with mysql, this comes up:

ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2)

- What steps could someone else take to reproduce the issue you’re having?

  • Install ghost with the digital ocean one-click installation
  • have another ghost installation in another folder on the same droplet following this link Set-up Multiple Ghost Blogs on One Digital Ocean Droplet
    Both of my sites were up. Then I went to update to Ghost v4
  • update npm from 6.14.4 → 7.6.3 using npm install -g npm
  • update ghost-cli
  • update the second ghost installation from 3.40.5 to 3.42.3 using ghost update v3
  • try to update the second installation to v4 by using ghost update, but database is down
1 Like

Ok this seemed to help:

Try this command,

sudo service mysql start

My database seems to be up and Ghost instance is running again (but there seems to be a NGINX problem still).

Edit: Ok both my sites are now back up! I changed the port of the second site to 2369, using:

ghost config server.port 2369

The command in the StackOverflow post helped, and I will also link this topic as I used it when I first got Ghost up and running according to the article:

And I have managed to successfully update to Ghost v4