Skip to content

Instantly share code, notes, and snippets.

@netpedro-com
netpedro-com / databases.sh
Last active February 1, 2018 07:45 — forked from stefanotorresi/databases.sh
Initialising multiple databases inside a Docker MySQL image
#!/usr/bin/env bash
# ** usage **
# initialize a MYSQL_DATABASES env variable in the container with space separated db names
# e.g. MYSQL_DATABASES="foo bar"
# assumes that MYSQL_ROOT_PASSWORD and MYSQL_USER are set
function create_database() {
local DATABASE=$1