Database setup
By default the dev environment is set up with a Postgres database running on the host reachable as db
from within the docker container where the code is running. In the setup screen, set the type to "PostgreSQL", leave the "Port" as 0, and set all the other fields to db
,
The generated .htconfig.php
file should contain the following after you're done:
$db_host = 'db';
$db_port = '0';
$db_user = 'db';
$db_pass = 'db';
$db_data = 'db';
$db_type = '1'; // an integer. 0 or unset for mysql, 1 for postgres
If you prefer to use MySQL or Mariadb as the database backend instead, you can change this by issuing the command:
% ddev config --database=mariadb:10.11
And then restart the environment by running ddev restart
.