This repository uses the official MariaDB Docker image to demonstrate how to manage semi-structured, via JavaScript Objection Notation (JSON), within a MariaDB database.
This README will walk you through the steps for getting a MariaDB database up and running, using a Docker container, and automatically create a database, table and pre-load the table with data.
This sample requires that you have the following installed:
The following provides for getting started using JSON with MariaDB (via a MariaDB database instance within a Docker container).
-
Pull down this respository by either downloading it directly or use git (through CLI or a client) to retrieve the code using
git clone
:$ git clone https://github.com/mariadb-developers/mariadb-json-quickstart.git
-
Navigate to the root of this sample, and execute the docker-compose up command to run docker-compose.yml:
$ docker-compose up -d
Note: The
docker-compose up
command will use the docker-compose.yml file to spin up a new Docker container (using the official MariaDB Docker image) and execute SQL to create a new database (places
), tables (locations
), and load it with sample data. -
Use the
docker
CLI command to use themariadb
command-line client, included in the Docker container, to connect and query your MariaDB database.$ docker exec -it mdb_json mariadb -u root -pPassword123!
which will load the MariaDB command-line client, which will enable to start executing SQL using MariaDB JSON functionality.
Please feel free to submit PR's, issues or requests to this project project directly.
If you have any other questions, comments, or looking for more information on MariaDB please check out:
Or reach out to us diretly via: