Rate this post

Last Updated on August 22, 2022 by Vikash Ekka

How to Install MySQL 8.0 on CentOS 8 / RHEL 8 | vetechno
How to Install MySQL 8.0 on CentOS 8 / RHEL 8 | vetechno

Hey reader, In this tutorial we are going to install mysql 8.0.29, which is the latest version of mysql community. 

MySQL is an open-source database management system and free to use. It is commonly installed as part of the most popular LAMP (Linux, Apache, MySQL, PHP/Python/Perl) stack and LEMP (Linux, Nginx, MySQL, PHP) stack.

It uses a relational database and SQL (Structured Query Language) to manage its data. It is the most common software stack that comes up with dynamic websites and web applications.

This tutorial will help you to install MySQL 8.0 on CentOS 8 and RHEL 8 systems.


* Need root user access.

* Internet

* CentOS 8 / REHL 8

Also read 


Install MySQL 8.0 on CentOS 8 / RHEL 8

The default Application Stream repository helps you to install the latest version of the MySQL 8.0 on CentOS 8 and RHEL 8 systems using the following yum command.

Step1. Install the required packages using the following command. 

@mysql is a module that will help you to download and install the MySQL server and its dependencies along with it.
vikash@vetechno:~$   sudo dnf -y install @mysql

Step2. Now we need to enable the MySQL service to auto-start on the system start.

vikash@vetechno:~$   sudo systemctl enable mysqld.service
vikash@vetechno:~$   sudo systemctl start mysqld.service
Step3. Check MySQL service status using the following command.

vikash@vetechno:~$   sudo systemctl status mysqld.service

 Secure MySQL Installation

We have successfully installed the MYSQL on CentOs. Now you can connect the MySQL server without any password but we recommend to secure the MySQL installation. The MySQL packages provide mysql_secure_installation command to apply the security. Just run the below command on terminal:

vikash@vetechno:~$   sudo mysql_secure_installation

Follow the on screen and input below details.

# Press y|Y for Yes, any other key for No: y
# Please enter 0 = LOW, 1 = MEDIUM and 2 = STRONG: 2
# Re-enter new password: RE ENTER PASSWORD HERE
# Do you wish to continue with the password provided?(Press y|Y for Yes, any other key for No) : y
# Remove anonymous users? (Press y|Y for Yes, any other key for No) : y
# Disallow root login remotely? (Press y|Y for Yes, any other key for No) : y
# Remove test database and access to it? (Press y|Y for Yes, any other key for No) : y
# Reload privilege tables now? (Press y|Y for Yes, any other key for No) : y

Log into MySQL

Now connect to MySQL server via terminal.
vikash@vetechno:~$   mysql -u root -p 


You have successfully installed and configured MySQL 8.0 on CentOS 8 system.

Let us know if you are facing any issue while installing in comment section, we will happy to help you.

Also read 


You may Also like

By Vikash Ekka

Hi All, My name is Vikash Ekka from India. I’m the founder and tech editor of https://www.vetechno.in. I have completed my Graduation in BCA. I love to write technical articles like Windows, Linux & MAC Tutorials, Tips, Tricks, How To fix, Tutorials About Ethical Hacking & Cyber Security Guide, and Software Review. Currently, I have been working as an IT professional since 2018.

Leave a Reply

Your email address will not be published. Required fields are marked *