New Ghost v5.41.0 Unable To Connect To MySQL Database

Hi @mjw ,

First of all, my apologies for assuming that you have been part of the Ghost team, and Thank you for volunteering your personal time to assist and help with my enquires! Really appreciate you for that!

I have actually did another round of server-restart, re-setting up the whole process from scratch, but this time, I had followed the exact side-tracked suggestion you have provided earlier:


sudo apt update && sudo apt upgrade --yes
sudo apt install mysql-server --yes
sudo systemctl start mysql.service
sudo mysql

ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY 'root-password';
QUIT;

sudo mysql_secure_installation

sudo mysql -u root -p

CREATE USER 'user_site'@'localhost' IDENTIFIED BY 'site-password';
CREATE DATABASE site_prod;
GRANT ALL PRIVILEGES ON site_prod.* TO 'user_site'@'localhost';
FLUSH PRIVILEGES;
QUIT;

curl -sL https://deb.nodesource.com/setup_16.x | sudo -E bash
sudo apt install nodejs --yes
sudo npm install ghost-cli@latest -g
sudo mkdir -p /var/www/ghost-site
sudo chown ghost-user:ghost-user /var/www/ghost-site
sudo chmod 775 /var/www/ghost-site
cd /var/www/ghost-site
ghost install

Thankfully now it worked! The key reminder here is as you had mentioned: “As mentioned earlier, set the root password, and then login using the password method. Then create a user and database solely for Ghost use.” ;)

So just want to say a Big Thank You for the great help! ;)


Final Working Server Configs For Others To Reference:

  • ubuntu v22.04 (LTS) x64
  • nginx v1.18.0-6ubuntu14.3
  • mysql-server v8.0.32-0ubuntu0.22.04.2
  • nodejs v16.19.1-deb-1nodesource1
  • npm v9.6.3
  • ghost-cli v1.24.0
  • ghost v5.41.0
1 Like