# \[Solved\] DK0051 Error: Access denied despite matching passwords in config.json and Docker

**URL:** <https://community.kinsta.com/t/solved-dk0051-error-access-denied-despite-matching-passwords-in-config-json-and-docker/5798>\
**Category:** Community Guides\
**Created:** [December 11, 2025, 9:33am UTC](https://community.kinsta.com/t/solved-dk0051-error-access-denied-despite-matching-passwords-in-config-json-and-docker/5798 "2025-12-11T09:33:34Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![blackawa](https://sea2.discourse-cdn.com/flex020/user_avatar/community.kinsta.com/blackawa/32/5264_2.png) [@blackawa](https://community.kinsta.com/u/blackawa)\
**Post date:** [December 11, 2025, 9:33am UTC](https://community.kinsta.com/t/solved-dk0051-error-access-denied-despite-matching-passwords-in-config-json-and-docker/5798/1 "2025-12-11T09:33:34Z")

</div>

Hi everyone,

I wanted to share a solution for the **DK0051** error (“Access denied”) that I recently encountered, in case anyone else gets stuck in the same loop.

The Issue:

I was getting the following error when trying to delete a site:

Error - DK0051: DELETE\_SITE\_DATABASE: Error (1): UERROR 1045 (28000): Access denied for user ‘root’@‘localhost’ (using password: YES)

The Confusion:

I checked the password in DevKinsta/config.json and compared it with the MYSQL\_ROOT\_PASSWORD environment variable in Docker Desktop (docker inspect devkinsta\_db). They were identical.

Since the passwords matched, I couldn’t understand why access was being denied.

The Diagnosis:

I decided to access the database container directly to investigate.

1. I opened the terminal and ran: `docker exec -it devkinsta_db bash`

2. I tried logging in **without a password** : `mysql -u root`

Surprisingly, **I was able to log in without a password** , even though the Docker environment variable showed a password was set. It seems the actual database user privileges were out of sync with the Docker configuration.

The Solution:

I manually reset the root password to match what DevKinsta expects (the one found in config.json).

Inside the container (`docker exec -it devkinsta_db bash`), I ran:

SQL

```auto
mysql -u root
-- Once logged in:
FLUSH PRIVILEGES;
ALTER USER 'root'@'localhost' IDENTIFIED BY 'YOUR_PASSWORD_FROM_CONFIG_JSON';
exit

```

_(Make sure to replace `YOUR_PASSWORD_FROM_CONFIG_JSON` with your actual password found in the config file)._

After doing this, DevKinsta was able to connect and the error was resolved.

Hope this helps!
