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
[mariadb] name = MariaDB baseurl = http://yum.mariadb.org/10.3/centos73-amd64/ gpgkey=https://yum.mariadb.org/RPM-GPG-KEY-MariaDB gpgcheck=1
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.
#mysql_secure_installation
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)]>
Ref: https://yallalabs.com/linux/how-to-install-mariadb-10-3-on-centosrhel-7/