Installing mariadb 10.2 mysql 5.7 in centos

If you use the following method to install the latest mariadb, updates will be installed with the regular yum update commands! The first part is to add the mariadb official repo to your system.
1) firstly, create an empty file at /etc/yum.repos.d/mariadb.repo

sudo touch /etc/yum.repos.d/mariadb.repo

2) paste in the info from the official mariadb repo

# MariaDB 10.2 CentOS repository list - created 2018-03-27 18:29 UTC
name = MariaDB
baseurl =

3) next, run ‘yum update’ to get the latest package info from all your repos and the new mariadb repo
4) install mariadb: yum install Mariadb-server Mariadb-Client (if it doesnt automatically pick it up during the update)
5) restart the mariadb service: service mariadb restart (or systemctl restart mariadb)