How to install mariadb on amazon linux

I was able to install the MariaDB 5.5 CentOS repository list (created 2016-05-09 04:06 UTC).

Create the following file:

sudo vi /etc/yum.repos.d/maria.repo

Add the following contents to the file and save:

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

Then run the following commands:

sudo yum install -y MariaDB-server MariaDB-client
sudo /etc/init.d/mysql start

You should be all set. Run mysql -u root to log in.

You can secure MariaDB with the following command:

sudo mysql_secure_installation

More information: https://mariadb.com/kb/en/mariadb/mysql_secure_installation/

Fortunately, I was trying to install MariaDB on Amazon Linux, myself. Just now I got it to work as above.


Currently in Amazon Linux 2 you can install it with yum:

yum install mariadb

or

yum install mariadb-server