install MySql CentOS 8 RHEL8

MySQL is an open-source relational database management system (RDBMS) used to host several databases on a single server by allowing multi-user access to each database.

Data in a MySQL database are stored in tables. A table is a collection of related data and it comprises of rows and columns.
The latest MySQL 8.0.23 version is available to install from the default AppStream repository using its module and that is enabled by default on the CentOS 8 and RHEL 8 systems.

In following article you will understand how to install the latest MySQL version 8.0.23 on CentOS 8.

Use following command to install MySQL.

dnf install @mysql -y
Install MySql CentOS 8 RHEL 8

The @mysql module will install the most latest version of MySQL including all dependencies.

Once its installed check the status of mysql service by using following command.

systemctl status mysqld
Install MySql CentOS 8 RHEL 8

As you can see currently its service is inactive.

Now use following command to start its service.

systemctl start mysqld

Now run following command again to check mysql service status.

systemctl status mysqld
Install MySql CentOS 8 RHEL 8

To Enable automatically start on boot time use following command.

systemctl enable mysqld

Make sure to secure its installation by running the security script that carries several security based operations .

Install MySql CentOS 8 RHEL 8

Please make sure to follow the below steps after running this command mysql_secure_installation.
Enter current password for root (enter for none):
(If you did not set the password for MySql just press enter, you can set the password in next step)
Set root password? [Y/n] y
Remove anonymous users? [Y/n] y
Disallow root login remotely? [Y/n] n
Remove test database and access to it? [Y/n] y
Reload privilege tables now? [Y/n] y

Once installation is configured in a secured way. So, you can log in to the its shell, and you can start creating new databases and users.

That’s about it.

You can also learn to install VSFTPD on CentOS 8 and RHEL 8 Click here!