How to Install MySQL Community Server using yum repository in CentOS and RHEL 8 Linux

MySQL is an open source RDBMS that is widely used and available for Windows, Linux, MacOS, FreeBSD, HP-UX, AIX etc. it’s truely cross platform DBMS, which works on many platform. MySQL supports MyISAM and InnoDB storage engines which improve the server performance tuning and flexibility. InnoDB is the default storage engine. MySQL server can be administered using many open source and commercial tools and some of the popular tools are as below.

  1. MySQL workbench
  2. phpMyAdmin
  3. SQLYog
  4. HeidiSQL

In this tutorial, we will see the steps involved for installation of MySQL Community Server. Let’s get started.
Step 1: Download yum repository and install with command below.

Download for CentOS/RHEL 8
# wget https://repo.mysql.com/mysql80-community-release-el8-1.noarch.rpm
 
Download for CentOS/RHEL 7
# wget https://repo.mysql.com/mysql80-community-release-el7-1.noarch.rpm
Step 2: Install the downloaded package with command below.
# yum localinstall mysql80-community-release-el8-1.noarch.rpm
Step 3: The installation command adds the MySQL repository to your system. You can check MySQL yum repository added by following command.
# yum repolist enabled | grep “mysql.*-community.*”

Step 4: Install MySQL Community Server 
# yum install mysql-community-server
with above command will install following packages.
  1. mysql-community-common
  2. mysql-community-libs
  3. mysql-community-server
  4. mysql-community-client
Step 5: Start mysqld service with following command. 
# systemctl start mysqld.service
# systemctl status mysqld.service

Note: MySQL temporary password will generate under /var/log/mysqld.log after starting the mysql service. Check temporary password with command below.
# grep ‘temporary password’ /var/log/mysqld.log

Step 6: Hardening MySQL with mysql_secure_installation post installation. Set strong password mix of Alpha, Numeric and Special Character for root login.

This will ensure the followings:
1. set root password
2. removing anonymous users
3. disallow root login remotely
4. remove test database
5. reload the privileges
# mysql_secure_installation
Step 7: Login with following command. Enter password which you have just set during mysql_secure_installation
# mysql -u root -p
That’s it. We have successfully install mysql-community-server using yum repository. kindly do comment and share it with your near and dear ones. 

Leave a Comment