# New Ghost v5.41.0 Unable To Connect To MySQL Database

**URL:** <https://forum.ghost.org/t/new-ghost-v5-41-0-unable-to-connect-to-mysql-database/37518>\
**Category:** Installation\
**Created:** [April 2, 2023, 11:46am UTC](https://forum.ghost.org/t/new-ghost-v5-41-0-unable-to-connect-to-mysql-database/37518 "2023-04-02T11:46:06Z")\
**Posts on this page:** 1\
**Showing post:** 7

<div class="post-metadata">

**Author:** ![sgrobert](https://sea1.discourse-cdn.com/flex015/user_avatar/forum.ghost.org/sgrobert/32/12412_2.png) [@sgrobert](https://forum.ghost.org/u/sgrobert)\
**Post date:** [April 3, 2023, 1:45pm UTC](https://forum.ghost.org/t/new-ghost-v5-41-0-unable-to-connect-to-mysql-database/37518/7 "2023-04-03T13:45:36Z")

</div>

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:

> [@New Ghost v5.41.0 Unable To Connect To MySQL Database](https://forum.ghost.org/t/new-ghost-v5-41-0-unable-to-connect-to-mysql-database/37518/2):
>
> These steps should work for you on Ubuntu 22.04, so double-check the MySQL section. 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\_s…

```auto

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

---

_[View the full topic](https://forum.ghost.org/t/new-ghost-v5-41-0-unable-to-connect-to-mysql-database/37518)._
