1) Adding MariaDB Repositories
By default MariaDB 5.x Series was included all the Linux distribution and removed MySQL but they didn’t include MariaDB 10.x series and if you want Add MariaDB Repositories, use the below commands to add MariaDB Repositories on CentOS 7, RHEL 7 systems.
First Create file /etc/yum.repos.d/mariadb.repo then Copy and paste it.
[mariadb] name = MariaDB baseurl = http://yum.mariadb.org/10.1.17/centos7-amd64 gpgkey=https://yum.mariadb.org/RPM-GPG-KEY-MariaDB gpgcheck=1
2) Install MariaDB
run the following code
yum update yum install MariaDB-server MariaDB-client
3) Start MariaDB Service
Use the below command to start MariaDB server for further usage, and enable it in startup.
systemctl start mariadb systemctl enable mariadb systemctl is-enabled mariadb
4) Secure MariaDB
By default MariaDB wont have root password and it’s security issue. So, run the below command to secure MariaDB installation, This will set root password for MariaDB also set other permission and remove test databases too.
and look over the following images.
mysql -u root -p
give your root password.