Skip to content
Search

MariaDB

lastmod 2025-05-21created 2015-05-1611 edits

MariaDB is an open-source relational database management system (RDBMS). It is based on the same source code as MySQL and is licensed under GPL v2. It was created in reaction to the currently uncertain licensing status of MySQL, which is owned by Oracle, and distributors must share copyright with Monty Program AB. This is to maintain high compatibility with MySQL: by exactly matching MySQL APIs and commands and providing library binary equivalence, it aims to make MariaDB easier to swap in. MariaDB includes not only Aria, a new storage engine, but also the XtraDB storage engine, which can replace InnoDB. This is presumably meant to cover transactional and non-transactional engines, as well as future MySQL versions.

MariaDB's lead developer is Michael Monty Widenius, who founded MySQL and Monty Program AB. He previously sold his company, MySQL AB, to Sun Microsystems for 1 billion dollars, and MariaDB is named after his second daughter, Maria.

How to install

MariaDB is shipped in the CentOS repo as of CentOS 7. Anything lower will need require you to add the additional repository to your server. Run the following command on your server:

$ yum update -y
$ yum install mariadb mariadb-server

Depending on if you are using the default Vultr image of CentOS 7 or if you are using a Custom ISO, you may need to manually start MariaDB and enable it to start on boot of the server. To do so, run:

$ systemctl start mariadb.service
$ systemctl enable mariadb.service

You may also need to finish the installation by running:

$ /usr/bin/mysql_secure_installation

You can check to see if everything is running by executing the following command:

$ systemctl is-active mariadb.service

Docker Run

Settings I often use for local demos:

docker run -d --name root-1234 -p 3306:3306 -e MARIADB_ROOT_PASSWORD=1234 mariadb:latest

Port binding

docker run --name some-mariadb -p 3306:3306 mariadb:latest

Starting using a minimal configuration

The environment variables required to use this image involves the setting of the root user password:

docker run --detach --name some-mariadb --env MARIADB_ROOT_PASSWORD=my-secret-pw mariadb:latest

Example

Change the root password:

$ update user set password=password('opennaru') where user='root';

Call the script that applies security settings:

## Secure the database service including choosing a suitable password for the root account:
$ mysql_secure_installation

Category

Favorite site

author Zer0 sitemap