Database access credentials

Edit on GitHub

In this document, you can find credentials for accessing your database. By default, you can access a database only in Development mode.

MySQL or MariaDB database:

  • host - localhost
  • port - 3306
  • user - spryker
  • pw - secret

PostgreSQL database:

  • host - localhost
  • port - 5432
  • user - spryker
  • pw - secret

You can change the credentials in the Deploy file.

You can find the credentials in your project with this command:

$ grep SPRYKER_DB_ docker/deployment/default/env/cli/de.env | grep -v ROOT

Example output:

SPRYKER_DB_ENGINE=mysql
SPRYKER_DB_HOST=database
SPRYKER_DB_PORT=3306
SPRYKER_DB_DATABASE=eu-docker
SPRYKER_DB_USERNAME=spryker
SPRYKER_DB_PASSWORD=secret
SPRYKER_DB_CHARACTER_SET=utf8
SPRYKER_DB_COLLATE=utf8_general_ci

You then can connect to the database in this example like so:

# connect to cli first
$ docker/sdk cli
# inside the docker/sdk cli
╭─/data | Store: DE | Env: docker.dev | Debug: (.) | Testing: (.)
╰─$ mariadb -u $SPRYKER_DB_USERNAME -p$SPRYKER_DB_PASSWORD -h $SPRYKER_DB_HOST $SPRYKER_DB_DATABASE