# Cannot get self hosted install to work following directions

**URL:** <https://forum.ghost.org/t/cannot-get-self-hosted-install-to-work-following-directions/37221>\
**Category:** Installation\
**Created:** [March 20, 2023, 2:15pm UTC](https://forum.ghost.org/t/cannot-get-self-hosted-install-to-work-following-directions/37221 "2023-03-20T14:15:03Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![dwhiteddsoft](https://sea1.discourse-cdn.com/flex015/user_avatar/forum.ghost.org/dwhiteddsoft/32/23624_2.png) [@dwhiteddsoft](https://forum.ghost.org/u/dwhiteddsoft)\
**Post date:** [March 20, 2023, 2:15pm UTC](https://forum.ghost.org/t/cannot-get-self-hosted-install-to-work-following-directions/37221/1 "2023-03-20T14:15:03Z")

</div>

Pretty simple problem and hoping a pretty simple answer. I am by no means a Linux expert so please assume I might be missing a key piece assumed by more experienced Linux people. If I simply follow this ([How to install & setup Ghost on Ubuntu 16.04, 18.04, 20.04 or 22.04](https://ghost.org/docs/install/ubuntu/)) for a complete local install (no prior install, no migration, no external mysql database), I get database connection errors. Ghost install gives me:  
Message: Ghost was able to start, but errored during boot with: Access denied for user ‘root’@‘localhost’

And I look into the logs with journalctl I see a NO\_PASSWORD error. If I uninstall and, reinstall, then try to add a user to mysql before installing (granting all privileges) I get ER\_DBACCESS\_DENIED\_ERROR.

I am a little flummoxed at this point and would appreciate any pointers people have

---

<div class="post-metadata">

**Author:** ![mjw](https://sea1.discourse-cdn.com/flex015/user_avatar/forum.ghost.org/mjw/32/30781_2.png) [@mjw](https://forum.ghost.org/u/mjw)\
**Post date:** [March 20, 2023, 4:43pm UTC](https://forum.ghost.org/t/cannot-get-self-hosted-install-to-work-following-directions/37221/2 "2023-03-20T16:43:51Z")

</div>

You shouldn’t use root for the database, and when installing MySQL, do the following.

```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 'password';
QUIT;

sudo mysql_secure_installation

sudo mysql -u root -p

CREATE USER 'user_sitename'@'localhost' IDENTIFIED BY 'password';
CREATE DATABASE sitename_prod;
GRANT ALL PRIVILEGES ON sitename_prod.* TO 'user_sitename'@'localhost';
FLUSH PRIVILEGES;
QUIT;

```

Substitute username, database, and password accordingly.

Then use the newly created user when installing Ghost.
