Get Started

Step 1. Install MariaDB Server

  1. Install Locally: Download MariaDB Server stable version
  2. Use Cloud Providers
    • MariaDB on AWS Marketplace: We created pre-built MariaDB images on Amazon AWS. These images are a quick way to get a basic install of MariaDB up and running.
    • MariaDB on AWS RDS: MariaDB is one of the database options available when using Amazon's RDS service.
    • MariaDB on Azure: The MariaDB Enterprise Cluster offering in Microsoft Azure deploys 3 data/Galera nodes and 2 MariaDB MaxScale nodes, all running CentOS 7.
  3. Use Docker Image

Follow installation instructions.

Step 2. MariaDB Primer - Logging/Inserting/Viewing/Modifying

This primer should get you up and going with MariaDB in about 10 minutes. If you're new to relational databases, please read Introduction to Relational Databases.

After completing these steps you will have the basics of getting information in and out of an existing MariaDB database.

  1. Logging on: How to start the MariaDB Server
  2. Inserting: Adding data into the database
  3. Viewing: How to create SELECT statements
  4. Modifying: Changing existing database records

Check out our Knowledge Base to learn more about Basic SQL Statements.

Step 3. Getting started with MariaDB in Cloud

1. MariaDB on AWS Marketplace: We created pre-built MariaDB images on Amazon AWS. These images are a quick way to get a basic install of MariaDB up and running.

2. MariaDB on AWS RDS: MariaDB is one of the database options available when using Amazon's RDS service.

3. MariaDB on Azure: The MariaDB Enterprise Cluster offering in Microsoft Azure deploys 3 data/Galera nodes and 2 MariaDB MaxScale nodes, all running CentOS 7.

Step 4. Try NoSQL features with MariaDB

Dynamic columns allow one to store different sets of columns for each row in a table. It works by storing a set of columns in a blob and having a small set of functions to manipulate it.

1. Create a table with a BLOB column.

CREATE TABLE items
(id INT NOT NULL PRIMARY KEY AUTO_INCREMENT,
name varchar(100) NOT NULL,
attributes BLOB);

2. Insert data with dynamic column using COLUMN_CREATE( ) function.

INSERT INTO items (name, attributes) VALUES
('MariaDB t-shirt', COLUMN_CREATE('colour','blue', 'size','XXL')),
('MariaDB t-shirt', COLUMN_CREATE('colour','blue', 'size','XL')),
('Samsung Galaxy S5', COLUMN_CREATE('colour','white', 'OS', 'Android',
'type', 'phone')),
('Samsung Galaxy Pro 3', COLUMN_CREATE('colour','white', 'size',8,
'OS', 'Android', 'resolution','1920x1200', 'type','tablet'));

3. View table with COLUMN_JSON() function.

SELECT name AS Item,
COLUMN_JSON(attributes) AS 'Dynamic Columns'
FROM items LIMIT 1;

+-----------------+--------------------------------+
| Item            | Dynamic Columns                |
+-----------------+--------------------------------+
| MariaDB t-shirt | {"size":"XXL","colour":"blue"} |
+-----------------+--------------------------------+

4. Get a list of attributes from dynamic columns.

SELECT name AS Item,
COLUMN_LIST(attributes) AS 'Attribute Names'
FROM items;

+----------------------+------------------------------------------+
| Item                 | Attribute Names                          |
+----------------------+------------------------------------------+
| MariaDB t-shirt      | `size`,`colour`                          |
| MariaDB t-shirt      | `size`,`colour`                          |
| Samsung Galaxy S5    | `OS`,`type`,`colour`                     |
| Samsung Galaxy Pro 3 | `OS`,`size`,`type`,`colour`,`resolution` |
+----------------------+------------------------------------------+

5. Get a value from dynamic column with COLUMN_GET() function.

SELECT name AS Item,
COLUMN_GET(attributes, 'colour' AS CHAR) AS Colour
FROM items;

+----------------------+--------+
| Item                 | Colour |
+----------------------+--------+
| MariaDB t-shirt      | blue   |
| MariaDB t-shirt      | blue   |
| Samsung Galaxy S5    | white  |
| Samsung Galaxy Pro 3 | white  |
| The Name of the Rose | red    |
+----------------------+--------+

To learn more about features of dynamic column, follow our tutorials below.

Dynamic Columns Tutorial – Part 1: Introduction

Dynamic Columns Tutorial – Part 2: Searching and Updating