From 28c02163b6e9e8327223bdb3f87d8afe5b5b92c4 Mon Sep 17 00:00:00 2001 From: Alex MacArthur Date: Tue, 10 Sep 2019 17:01:34 -0500 Subject: [PATCH] Add MariaDB. --- mariadb/README.md | 17 +++++++++++++++++ mariadb/docker-compose.yml | 15 +++++++++++++++ 2 files changed, 32 insertions(+) create mode 100644 mariadb/README.md create mode 100644 mariadb/docker-compose.yml diff --git a/mariadb/README.md b/mariadb/README.md new file mode 100644 index 0000000..0310239 --- /dev/null +++ b/mariadb/README.md @@ -0,0 +1,17 @@ +# Enter the Container w/ Bash + +`docker-compose exec --user root db /bin/bash` + +# Enter the MySQL Shell + +`docker-compose exec --user root db mysql -u root -p` + +When prompted, enter `password` as the password. + +# Create a DB + +While inside the shell, run the following: + +``` +CREATE DATABASE mydatabase; +``` diff --git a/mariadb/docker-compose.yml b/mariadb/docker-compose.yml new file mode 100644 index 0000000..eef16f4 --- /dev/null +++ b/mariadb/docker-compose.yml @@ -0,0 +1,15 @@ +version: '3' + +services: + db: + image: mariadb:latest + volumes: + - dbdata:/var/lib/mysql + restart: always + ports: + - 3306:3306 + environment: + MYSQL_ROOT_PASSWORD: password + +volumes: + dbdata: