# MySQL Access Denied error

**URL:** <https://forum.ghost.org/t/mysql-access-denied-error/43647>\
**Category:** Installation\
**Created:** [December 28, 2023, 3:11am UTC](https://forum.ghost.org/t/mysql-access-denied-error/43647 "2023-12-28T03:11:05Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![chrysaora](https://sea1.discourse-cdn.com/flex015/user_avatar/forum.ghost.org/chrysaora/32/28059_2.png) [@chrysaora](https://forum.ghost.org/u/chrysaora)\
**Post date:** [December 28, 2023, 3:11am UTC](https://forum.ghost.org/t/mysql-access-denied-error/43647/1 "2023-12-28T03:11:05Z")

</div>

I am having this exact same problem despite following all the instructions here. Whenever I try to run sudo mysql -u root -p (using the password found in the root/.digitalocean\_password file generated by Ghost setup), I get the error

```auto
Access denied for user 'root'@'localhost' (using password: YES)

```

Any other ideas @mjw ?

---

<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:** [December 28, 2023, 10:04am UTC](https://forum.ghost.org/t/mysql-access-denied-error/43647/2 "2023-12-28T10:04:27Z")

</div>

What OS, and what steps did you follow?

Likewise, is native password supported? The `root` password isn’t the MySQL password.

This may help.

```auto
ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY '<password>';
QUIT;

```

---

<div class="post-metadata">

**Author:** ![FarawayJedi](https://sea1.discourse-cdn.com/flex015/user_avatar/forum.ghost.org/farawayjedi/32/28065_2.png) [@FarawayJedi](https://forum.ghost.org/u/FarawayJedi)\
**Post date:** [December 28, 2023, 2:59pm UTC](https://forum.ghost.org/t/mysql-access-denied-error/43647/3 "2023-12-28T14:59:32Z")

</div>

Assuming you’re using Ubuntu on your Digital Ocean droplet, you need to connect to it as root (you can use the Droplet console) and then run the following commands, as mentioned by @mjw (and also as mentioned in the [installation guide](https://ghost.org/docs/install/ubuntu/))

```auto
# Enter mysql
sudo mysql
# Update permissions
ALTER USER 'root'@'localhost' IDENTIFIED WITH 'mysql_native_password' BY '<your-new-root-password>';
# Reread permissions
FLUSH PRIVILEGES;
# exit mysql
exit

```

That will reset the password of the root MySQL user which then you can use in the Ghost installation script

---

<div class="post-metadata">

**Author:** ![chrysaora](https://sea1.discourse-cdn.com/flex015/user_avatar/forum.ghost.org/chrysaora/32/28059_2.png) [@chrysaora](https://forum.ghost.org/u/chrysaora)\
**Post date:** [December 29, 2023, 6:55pm UTC](https://forum.ghost.org/t/mysql-access-denied-error/43647/4 "2023-12-29T18:55:26Z")

</div>

I am using Ubuntu on my Digital Ocean droplet! When trying to follow those instructions, `sudo mysql` now gives me

```auto
Access denied for user 'root'@'localhost' (using password: NO)

```

Attempting to use `mysql -u root -p` gets me a password prompt, but I’m really not sure what password is expected here: I’ve tried leaving it blank, the root/.digitalocean\_password, and my actual login password (used to SSH in to the root account)—none work. Without getting past this step, I can’t run the ALTER command to (re)set the password, so I’m a bit stuck. I feel like I must be missing something obvious here!

---

<div class="post-metadata">

**Author:** ![FarawayJedi](https://sea1.discourse-cdn.com/flex015/user_avatar/forum.ghost.org/farawayjedi/32/28065_2.png) [@FarawayJedi](https://forum.ghost.org/u/FarawayJedi)\
**Post date:** [December 30, 2023, 12:59pm UTC](https://forum.ghost.org/t/mysql-access-denied-error/43647/5 "2023-12-30T12:59:26Z")

</div>

Strange. Assuming you have nothing on that droplet, I recommend starting over and choosing the Ghost image from the Marketplace when creating a new droplet:

 ![droplet-ghost](https://us1.discourse-cdn.com/flex015/uploads/ghost2/original/3X/e/a/ea128b341009a5380085f09c7af26449bf43b85c.png)

It’s way easier, and Ghost would be pre-installed, avoiding the issue you mentioned.
