Installation and basic setup of MySQL on Centos 8 RPM
Last updated: Jun 02, 2022
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.
- Download RPM.
- Unpack the RPM.
- Install RPM packages.
- Launching the DBMS.
- Find the password for the root account.
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).
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.
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
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
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:
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 DBMS installed successfully.
4. We start the DBMS.
To start the Mysql DBMS, use the command:
$. service mysqld start
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.
We need to save this password, then we will change it.
To set up basic things in the Mysql DBMS, let's run the server setup through mysql_secure_installation.
Enter the password for the root account that we copied from the file mysqld.log
Next, we write our password and confirm it.
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.
When asked whether to delete an anonymous user, we answer yes.
Next, we agree to not forbid connection to our north from remote servers.
Next, it will ask whether to delete the test database, we write yes, we do not need it.
And the last step, it will ask whether to reload the table with privileges with their further activation, we write yes.
To check if we did everything right, let's connect through the mysql console.
$. mysql -u root -p
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.