mysqldrupalmariadbmultisiteddev

How can I create and load a second database in ddev?


I have a Drupal multisite that needs to have one database for each site, and want it to run in ddev, but ddev just has the one database by default, named 'db'. How can I get a second database?


Solution

  • You can import additional databases directly with ddev import-db --database=newdb --file=/path/to/file.sql.gz. The created database will already have permissions, etc.

    You can also manually create and manage databases (although this is rarely necessary). The root password for the db server is 'root', so you can mysql -uroot -proot in there (or use ddev mysql -uroot -proot).

    More details about database management at https://ddev.readthedocs.io/en/stable/users/usage/database-management/