Installation and basic setup of MySQL on Centos 8 RPM

Installation and basic setup of MySQL on Centos 8 RPM

Colleagues hello to all.

Mysql is a  free relational database management system, and in today's article we'll talk about how to install Mysql on Centos 8 from an RPM package. We will install the version 8.0.29. 

 

Article content:

  1. Download RPM.
  2. Unpack the RPM.
  3. Install RPM packages.
  4. Launching the DBMS.
  5. Find the password for the root account.
  6. mysql_secure_installation.
  7. Check.
  8. Summary

 

1. Download RPM.

1.1. In order for us to download the mysql rpm package, we need to go to the page https://dev.mysql.com/downloads/mysql/, then choose Select Operating System: Red Hat Enterprice Linux / Oracle Linux, then Select OS Version: Oracle Linux 8 (x86, 64-bit).

https://dev.mysql.com/downloads/mysql/

mysql_install_rpm

In the list that appears below, we need exactly the RPM Bundle, click on download.

 

1.2. After clicking on the downlod, we will be redirected to the rpm package download page.

mysql_install_rpm

We just need to copy the link No thanks, just start my download. to download. DO NOT DOWNLOAD JUST COPY THE LINK!

 

1.3. The next step is to go to your server and use the wget utility to download the rpm package.

$. wget https://dev.mysql.com/get/Downloads/MySQL-8.0/mysql-8.0.29-1.el8.x86_64.rpm-bundle.tar

mysql_install_rpm

As you can see in the screenshot, we have successfully downloaded the mysql subd rpm package.


 

2. Unpack RPM.

The next step after downloading the rpm package, we now need to unzip it. To do this, use the tar utility:

$. tar -xvf mysql-8.0.29-1.el8.x86_64.rpm-bundle.tar

mysql_install_rpm

If you did everything right, then you will have a small list with all mysql components.


 

3. Installing RPM packages.

To install the Mysql DBMS, we do not need the entire list that you have after unzipping the main rpm package.

It will be enough for us just:

  • mysql-community-common
  • mysql-community-libs
  • mysql-community-client
  • mysql-community-server
  • mysql-community-client-plugins
  • mysql-community-icu-data-files

Well, if you are still missing something, you can install the package you need.

We will install packages using the rpm utility.

$. rpm -Uvh mysql-community-common-8.0.29-1.el8.x86_64.rpm mysql-community-client-8.0.29-1.el8.x86_64.rpm mysql-community -libs-8.0.29-1.el8.x86_64.rpm mysql-community-server-8.0.29-1.el8.x86_64.rpm mysql-community-icu-data-files-8.0.29-1.el8.x86_64 .rpm mysql-community-client-plugins-8.0.29-1.el8.x86_64.rpm

mysql_install_rpm

Mysql DBMS installed successfully.


 

4. We start the DBMS.

To start the Mysql DBMS, use the command:

$. service mysqld start

mysql_install_rpm


 

5. Finding the password for the root account.

Mysql DBMS generates a password for the root account and puts it in the  mysqld.log file located in the /var/log directory.

mysql_install_rpm

We need to save this password, then we will change it.


 

6. mysql_secure_installation

To set up basic things in the Mysql DBMS, let's run the server setup through mysql_secure_installation.

$. mysql_secure_installation

mysql_install_rpm

Enter the password for the root account that we copied from the file mysqld.log

 

Next, we write our password and confirm it.

mysql_install_rpm

 

The next steps it will ask you need to change the password for the root account, we write no because we have already changed it.

mysql_install_rpm

 

When asked whether to delete an anonymous user, we answer yes.

mysql_install_rpm

 

Next, we agree to not forbid connection to our north from remote servers.

mysql_install_rpm

 

Next, it will ask whether to delete the test database, we write yes, we do not need it.

mysql_install_rpm

 

And the last step, it will ask whether to reload the table with privileges with their further activation, we write yes.

mysql_install_rpm

Done!


 

7. Check.

To check if we did everything right, let's connect through the mysql console.

$. mysql -u root -p

mysql_install_rpm


 

8. Results.

Today, colleagues, we have successfully deployed the Mysql DBMS from RPM packages. In the next article, I will show you how to install a database from source files by already advanced specialists.

SIMILAR ARTICLES

MySQL - Test Data Generation
MySQL - Test Data Generation
MYSQL
Read more
MySQL / MariaDB How to get the id of the last inserted record in a table - LAST_INSERT_ID
MySQL / MariaDB How to get the id of the last inserted record in a table - LAST_INSERT_ID
MYSQL
Read more
MySQL/MariaDB How to convert character case - UPPER and LOWER functions
MySQL/MariaDB How to convert character case - UPPER and LOWER functions
MYSQL
Read more