Psychz - Nikhil
Votes: 0Posted On: Oct 05, 2017 03:00:19
Hi!
I can understand your confusion as in CentOS 7 the MariaDB is installed when you type in the command "yum install mysql". MariaDB is a fork of MySQL and works really well with CentOS 7. Hence, if you want to install MySQL, you will have to download the files directly from the site. However, it is recommended that you use MariaDB until you have a specific task from MySQL.
The following steps will guide you towards the installation of MySQL on CentOS 7.
(Note: Uninstall MariaDB from the system as it can interfere with the installation.) \
Prerequisites
1. CentOS 7 operating system
2. A user with sudo privileges
Getting the MySQL package
To get the MySQL package, you will first have to view the name of the package from the MySQL yum repository web page.
https://dev.mysql.com/downloads/repo/yum/
Here is a sample output for the following.
Here we will select "Red Hat Enterprise Linux 7 / Oracle Linux 7 (Architecture Independent), RPM Package" package. Just copy the package name given in brackets and include in the following command. This command will save the file in your system.
wget https://dev.mysql.com/get/mysql57-community-release-el7-11.noarch.rpm
Installing the MySQL package
You can check the package integrity by running the following command and comparing its value with the value on the web page.
md5sum mysql57-community-release-el7-11.noarch.rpm
Now that we have downloaded and verified the package, we will install it by running the following commands.
sudo rpm -ivh mysql57-community-release-el7-11.noarch.rpm
sudo yum install mysql-server
Starting MySQL services
The MySQL services can be started with the help of the following command.
sudo systemctl start mysqld
To check if the service is started, you can check its status by running the following command.
sudo systemctl status mysqld
Once you have installed and started the MySQL service, you can configure it as per your liking.