# Problem when changing dbhost in config

**URL:** <https://forum.ghost.org/t/problem-when-changing-dbhost-in-config/25175>\
**Category:** Developer help\
**Created:** [August 25, 2021, 6:45pm UTC](https://forum.ghost.org/t/problem-when-changing-dbhost-in-config/25175 "2021-08-25T18:45:29Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![timscha](https://sea1.discourse-cdn.com/flex015/user_avatar/forum.ghost.org/timscha/32/18988_2.png) [@timscha](https://forum.ghost.org/u/timscha)\
**Post date:** [August 25, 2021, 6:45pm UTC](https://forum.ghost.org/t/problem-when-changing-dbhost-in-config/25175/1 "2021-08-25T18:45:30Z")

</div>

Ghost cannot use “127.0.0.1” instead of “localhost”, I got the error shown above.

- **What version of Ghost are you using?** 4.12.1

And

- How was Ghost installed and configured?  
via ghost-cli, nginx and MariaDB

- What Node version, database, OS & browser are you using?  
NodeJS v14.17.5, MariaDB 10.5, Safari and Firefox, latest versions

- What errors or information do you see in the console?  
Message: Ghost was able to start, but errored during boot with: ER\_ACCESS\_DENIED\_ERROR: Access denied for user ‘ghost-262’@‘localhost’ (using password: YES)  
Help: Unknown database error

- What steps could someone else take to reproduce the issue you’re having?

I changed my dbhost from “localhost” to “127.0.0.1”. I also changed the permissions inside MariaDB, I tested the local login via mysql -h127.0.0.1 -ughost-262 -p and the password provided in the config file.  
I also tried to configure ghost via ` ghost config set dbhost 127.0.0.1`

I also cleared cache via ghost buster. And yes, ghost was restarted.  
It looks like that ghost saved the old dbhost somewhere or cache it.

---

<div class="post-metadata">

**Author:** ![vikaspotluri123](https://sea1.discourse-cdn.com/flex015/user_avatar/forum.ghost.org/vikaspotluri123/32/24_2.png) [@vikaspotluri123](https://forum.ghost.org/u/vikaspotluri123)\
**Post date:** [August 25, 2021, 10:52pm UTC](https://forum.ghost.org/t/problem-when-changing-dbhost-in-config/25175/2 "2021-08-25T22:52:28Z")

</div>

You need to run `ghost config set database.connection.host 127.0.0.1` 🙂

---

<div class="post-metadata">

**Author:** ![timscha](https://sea1.discourse-cdn.com/flex015/user_avatar/forum.ghost.org/timscha/32/18988_2.png) [@timscha](https://forum.ghost.org/u/timscha)\
**Post date:** [August 26, 2021, 7:38am UTC](https://forum.ghost.org/t/problem-when-changing-dbhost-in-config/25175/3 "2021-08-26T07:38:32Z")

</div>

Hi @vikaspotluri123 Thank you for response.  
Unfortunately that also doesn`t work:

```auto
Message: Ghost was able to start, but errored during boot with: ER_ACCESS_DENIED_ERROR: Access denied for user 'ghost-262'@'localhost' (using password: YES)
Help: Unknown database error

```

---

<div class="post-metadata">

**Author:** ![vikaspotluri123](https://sea1.discourse-cdn.com/flex015/user_avatar/forum.ghost.org/vikaspotluri123/32/24_2.png) [@vikaspotluri123](https://forum.ghost.org/u/vikaspotluri123)\
**Post date:** [August 26, 2021, 2:59pm UTC](https://forum.ghost.org/t/problem-when-changing-dbhost-in-config/25175/4 "2021-08-26T14:59:38Z")

</div>

When you run `ls config*`, do you have 2 files or 1 file?

---

<div class="post-metadata">

**Author:** ![timscha](https://sea1.discourse-cdn.com/flex015/user_avatar/forum.ghost.org/timscha/32/18988_2.png) [@timscha](https://forum.ghost.org/u/timscha)\
**Post date:** [August 26, 2021, 3:16pm UTC](https://forum.ghost.org/t/problem-when-changing-dbhost-in-config/25175/5 "2021-08-26T15:16:17Z")

</div>

There is only the config.production.json file, with this details

```auto
  "database": {
    "client": "mysql",
    "connection": {
      "host": "127.0.0.1",
...

```
