Centos 7 comes with MariaDB instead of MySQL. MariaDB is a open source equivalent to MySQL and I am going to show you how to install it right now.

If you must have MySQL you need to add the mysql-community repo by using the following command

sudo rpm -Uvh http://dev.mysql.com/get/mysql-community-release-el7-5.noarch.rpm

and then you can install MySQL like you normally…

Now let me show you how to install MariaDB on CentOS7. The first step is to install the MariaDB server and client

sudo yum -y install mariadb-server mariadb

After running the above command we need to start the MariaDB server and enable it in systemd

sudo systemctl start mariadb.service
sudo systemctl enable mariadb.service

Now that MariaDB server is enable and running you need to run the install script. Run the following command and anwser the questions

sudo mysql_secure_installation

Now that you did everything you are all done… you can now login to the MariaDB server by using the client command


Now that’s it. have fun with MariaDB on CentOS7.


If you have any questions or comments please email me at john@johnathanmarksmith.com


16 October 2014