Install MariaDB 10.3 on CentOS

Step 1: Add MariaDB Yum Repository

 Create a new repo file /etc/yum.repos.d/mariadb.repo and add the below code changing the base url according to the operating system version and architecture.

# vi /etc/yum.repos.d/mariadb.repo
name = MariaDB
baseurl =

Step 2 – Install MariaDB Server

Let’s use the following command to install MariaDB 10.3

# yum install MariaDB-server MariaDB-client

Once the installation is complete, we’ll enable and start the daemon with the following commands:

# systemctl enable mysql.service
# systemctl start mysql.service

Step 3 – Secure MariaDB Install

MariaDB includes a security script “mysql_secure_installation”, to change some of the less secure default options. For things like removing remote root logins and sample and Anonymous users. To do this you can read our previous article Securing MySQL server / Mariadb with mysql_secure_installation from command line guide.


Step 4 – Working with MariaDB

Once the configuration is complete, connect to MariaDB server using the following command.

# mysql -u root -p
Welcome to the MariaDB monitor. Commands end with ; or \g.
Your MariaDB connection id is 16
Server version: 10.3.2-MariaDB MariaDB Server

Copyright (c) 2000, 2017, Oracle, MariaDB Corporation Ab and others.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

MariaDB [(none)]>



Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.