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: