Mariadb

Mariadb is very similar to mysql, its uses the same syntax and commands. The main difference between them both is when it comes to database replication, this is something that wont be covered on here for a while.

Quick Links:
Adding the Mariadb Repository
Installing Mariadb
Installing Mariadb PHP plugin

 

Mysql was previously fully opensource however since it’s purchase by Oracle has been becoming less and less opensource.  Mariadb IS fully opensource and is a good alternative to mysql (Only just become familiar with Maria however I now prefer this to mysql for a few different reasons which I will show throughout)

 

Adding Mariadb Repository CentOS:

Create a file called MariaDB.repo in the following location /etc/yum.repo.d/ and then add:

[mariadb]
name = MariaDB
baseurl = http://yum.mariadb.org/10.0/centos6-amd64
gpgkey=https://yum.mariadb.org/RPM-GPG-KEY-MariaDB
gpgcheck=1

Installing Mariadb

Once this has been added you can perform:

sudo yum install MariaDB-server MariaDB-client

This will now install mariadb. Start maria db with:

service mysql start

You can access mariadb using the same command as mysql

mysql -u root -p

You should now be greeted with:

MariaDB [(none)]>

The ‘none’ represents that you have not currently selected a db using the ‘use’ command. Please see mysql / Mariadb commands for more information

Mariadb PHP Plugin

If you are looking for mariadb with the php plugin you can install it with:

yum install php php-mysql php-gd php-pear

 

Mariadb can be installed over mysql as it uses the same binarys. This means you do not have to remove mysql before you install mariadb and it WILL keep your databases.