Problem when changing dbhost in config

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.

You need to run ghost config set database.connection.host 127.0.0.1 :slight_smile:

1 Like

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

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

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

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

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