1

I am experimenting with Nitro and getting the 503 db error when trying to connect db. I am able to connect to my GUI (Sequel Ace) but not get the browser connecting.

My db.php is as follows:

return [
    'driver' => getenv('DB_DRIVER'),
    'server' => getenv('DB_SERVER'),
    'user' => getenv('DB_USER'),
    'password' => getenv('DB_PASSWORD'),
    'database' => getenv('DB_DATABASE'),
    'schema' => getenv('DB_SCHEMA'),
    'tablePrefix' => getenv('DB_TABLE_PREFIX'),
    'port' => getenv('DB_PORT')
];

With the relevant .env file snippet:

DB_DRIVER=mysql
DB_HOST="mysql-5.7-3306.database.nitro" # I got this from running nitro context
DB_SERVER=127.0.0.1
DB_USER="nitro"
DB_PASSWORD="nitro"
DB_DATABASE=nitro_play
DB_SCHEMA=
DB_TABLE_PREFIX=
DB_PORT=3306

1 Answer 1

1

I don't think that host is a valid configuration key for the Connection component.

127.0.0.1 won't work for the server key (within Nitro), so I'd recommend moving the value of the DB_HOST variable over to DB_SERVER, and removing the host key from the config object entirely!

1
  • Thank you for your help! @August Miller
    – peco60052
    Jan 19 at 20:09

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.