Install MySQL

Installing MySQL on Centos

Uninstall MariaDB

Uninstall MariaDB from the server

yum remove MariaDB-server MariaDB-client

Add the MySQL repository

Download and add the following MySQL Yum repository

Downloading respository data

============================

wget https://repo.mysql.com/mysql80-community-release-el7-1.noarch.rpm

Installing the repository data

==============================

yum localinstall mysql80-community-release-el7-1.noarch.rpm

Verify if the MySQL Yum repository has been added successfully

with the command below very that the MySQL Yum repository has been added successfully

yum repolist enabled | grep "mysql.*-community.*"

The result should be similar to

Installing MySQL Release Series

If a specific release series is required follow the following steps

If not already installed, install yum-config-manageryum update && yum install yum-utils

Disable the current active sub-repository, where [xx] replaces the version numberyum-config-manager --disable mysql[xx]-community

Enable the appropriate sub-repository, where [xx] replaces the version numberyum-config-manager --enable mysql[xx]-community

Install MySQL

Install MySQL with the command belowyum install mysql-community-server

Start and enable MySQL

Start and enable MySQL with the commands below

Start mySQL

===========

systemctl start mysqld

Enable Mysql

============

systemctl enable mysqld

Secure MySQL installation

Lastly, secure the installation of MySQL by running the command below and following the prompts

mysql_secure_installation

