MySQL is a very popular and powerful Open Source Relational SQL Database Management System. It is being used in a variety of web-based software applications, from simple web applications to running of mission critical transactions. MySQL is being developed and supported by MySQL AB, a Swedish company.

MySQL is a multi-user, multi-threaded SQL database server that uses a client/server implementation consisting of a server daemon (mysqld) and many different client programs and libraries.

This tutorial will guide you through the installation of MySQL 8.0 on an Oracle Linux 8 server. MySQL 8 ships with new features that you can read in the release notes. The following are the steps you’ll follow to install MySQL 8.0 on Oracle Linux 8.

Install MySQL 8.0 on Oracle Linux 8

Follow the steps below to install, configure, and start MySQL 8.0 on Oracle Linux 8. Since the installation is done from the YUM repository, updating the MySQL database server is an easy process.

Step 1: Update your system

Ensure your system is updated.

sudo yum update

Confirm list of a packages to be updated and hit the y key if you’re okay with it.

Dependencies resolved.
 Package                                   Architecture             Version                                   Repository                           Size
 kernel                                    x86_64                   4.18.0-193.1.2.el8_2                      ol8_baseos_latest                   2.8 M
 kernel-core                               x86_64                   4.18.0-193.1.2.el8_2                      ol8_baseos_latest                    28 M
 kernel-modules                            x86_64                   4.18.0-193.1.2.el8_2                      ol8_baseos_latest                    23 M
 bpftool                                   x86_64                   4.18.0-193.1.2.el8_2                      ol8_baseos_latest                   3.4 M
 gnutls                                    x86_64                   3.6.8-10.el8_2                            ol8_baseos_latest                   915 k
 iproute                                   x86_64                   5.4.0-1.0.1.el8                           ol8_UEKR6                           665 k
 kernel-tools                              x86_64                   4.18.0-193.1.2.el8_2                      ol8_baseos_latest                   2.9 M
 kernel-tools-libs                         x86_64                   4.18.0-193.1.2.el8_2                      ol8_baseos_latest                   2.8 M
 nftables                                  x86_64                   1:0.9.3-12.0.1.el8                        ol8_baseos_latest                   311 k
 oraclelinux-release                       x86_64                   8:8.2-1.0.8.el8                           ol8_baseos_latest                    66 k
 python3-nftables                          x86_64                   1:0.9.3-12.0.1.el8                        ol8_baseos_latest                    25 k
 python3-perf                              x86_64                   4.18.0-193.1.2.el8_2                      ol8_baseos_latest                   2.9 M
 selinux-policy                            noarch                   3.14.3-41.0.1.el8_2.2                     ol8_baseos_latest                   615 k
 selinux-policy-targeted                   noarch                   3.14.3-41.0.1.el8_2.2                     ol8_baseos_latest                    15 M
 systemd                                   x86_64                   239-30.0.2.el8_2                          ol8_baseos_latest                   3.5 M
 systemd-libs                              x86_64                   239-30.0.2.el8_2                          ol8_baseos_latest                   1.1 M
 systemd-pam                               x86_64                   239-30.0.2.el8_2                          ol8_baseos_latest                   450 k
 systemd-udev                              x86_64                   239-30.0.2.el8_2                          ol8_baseos_latest                   1.3 M
 tzdata                                    noarch                   2020a-1.el8                               ol8_baseos_latest                   469 k
 xfsprogs                                  x86_64                   5.4.0-1.el8                               ol8_UEKR6                           1.1 M

Transaction Summary
Install   3 Packages
Upgrade  17 Packages

Total download size: 92 M
Is this ok [y/N]: y

Reboot your machine:

$ sudo systemctl reboot

Confirm the current release of Oracle Linux 8 you’re running:

$ cat /etc/oracle-release 
Oracle Linux Server release 8.2

Step 2: Install MySQL 8.0 on Oracle Linux 8

MySQL 8.0 package is available on the AppStream repository of the Oracle Linux operating system.

$ sudo dnf module list mysql
Last metadata expiration check: 0:06:21 ago on Fri 29 May 2020 10:27:56 PM UTC.
Oracle Linux 8 Application Stream (x86_64)
Name                             Stream                             Profiles                                      Summary                               
mysql                            8.0 [d]                            client, server [d]                            MySQL Module                          

Hint: [d]efault, [e]nabled, [x]disabled, [i]nstalled

To Install MySQL 8.0 on Oracle Linux 8 server, run the command below.

sudo dnf install @mysql:8.0

Accept the installation of MySQL 8.0 on Oracle Linux 8.0:

Dependencies resolved.
 Package                                 Architecture        Version                                               Repository                      Size
Installing group/module packages:
 mysql-server                            x86_64              8.0.17-3.module+el8.0.0+5253+1dce7bb2                 ol8_appstream                   22 M
Installing dependencies:
 mariadb-connector-c-config              noarch              3.0.7-1.el8                                           ol8_appstream                   13 k
 mecab                                   x86_64              0.996-1.module+el8.0.0+5253+1dce7bb2.9                ol8_appstream                  397 k
 mysql                                   x86_64              8.0.17-3.module+el8.0.0+5253+1dce7bb2                 ol8_appstream                   11 M
 mysql-common                            x86_64              8.0.17-3.module+el8.0.0+5253+1dce7bb2                 ol8_appstream                  143 k
 mysql-errmsg                            x86_64              8.0.17-3.module+el8.0.0+5253+1dce7bb2                 ol8_appstream                  557 k
 perl-Carp                               noarch              1.42-396.el8                                          ol8_baseos_latest               30 k
 perl-Encode                             x86_64              4:2.97-3.el8                                          ol8_baseos_latest              1.5 M
 perl-Errno                              x86_64              1.28-416.el8                                          ol8_baseos_latest               76 k
 perl-Exporter                           noarch              5.72-396.el8                                          ol8_baseos_latest               34 k
 perl-File-Path                          noarch              2.15-2.el8                                            ol8_baseos_latest               38 k
 perl-File-Temp                          noarch              0.230.600-1.el8                                       ol8_baseos_latest               63 k
 perl-Getopt-Long                        noarch              1:2.50-4.el8                                          ol8_baseos_latest               63 k
 perl-HTTP-Tiny                          noarch              0.074-1.el8                                           ol8_baseos_latest               58 k
 perl-IO                                 x86_64              1.38-416.el8                                          ol8_baseos_latest              141 k
 perl-MIME-Base64                        x86_64              3.15-396.el8                                          ol8_baseos_latest               31 k
 perl-PathTools                          x86_64              3.74-1.el8                                            ol8_baseos_latest               90 k
 perl-Pod-Escapes                        noarch              1:1.07-395.el8                                        ol8_baseos_latest               20 k
 perl-Pod-Perldoc                        noarch              3.28-396.el8                                          ol8_baseos_latest               88 k
 perl-Pod-Simple                         noarch              1:3.35-395.el8                                        ol8_baseos_latest              213 k
 perl-Pod-Usage                          noarch              4:1.69-395.el8                                        ol8_baseos_latest               34 k
 perl-Scalar-List-Utils                  x86_64              3:1.49-2.el8                                          ol8_baseos_latest               68 k
 perl-Socket                             x86_64              4:2.027-3.el8                                         ol8_baseos_latest               59 k
 perl-Storable                           x86_64              1:3.11-3.el8                                          ol8_baseos_latest               98 k
 perl-Term-ANSIColor                     noarch              4.06-396.el8                                          ol8_baseos_latest               46 k
 perl-Term-Cap                           noarch              1.17-395.el8                                          ol8_baseos_latest               23 k
 perl-Text-ParseWords                    noarch              3.30-395.el8                                          ol8_baseos_latest               18 k
 perl-Text-Tabs+Wrap                     noarch              2013.0523-395.el8                                     ol8_baseos_latest               24 k
 perl-Time-Local                         noarch              1:1.280-1.el8                                         ol8_baseos_latest               33 k
 perl-Unicode-Normalize                  x86_64              1.25-396.el8                                          ol8_baseos_latest               82 k
 perl-constant                           noarch              1.33-396.el8                                          ol8_baseos_latest               25 k
 perl-interpreter                        x86_64              4:5.26.3-416.el8                                      ol8_baseos_latest              6.3 M
 perl-libs                               x86_64              4:5.26.3-416.el8                                      ol8_baseos_latest              1.6 M
 perl-macros                             x86_64              4:5.26.3-416.el8                                      ol8_baseos_latest               72 k
 perl-parent                             noarch              1:0.237-1.el8                                         ol8_baseos_latest               20 k
 perl-podlators                          noarch              4.11-1.el8                                            ol8_baseos_latest              118 k
 perl-threads                            x86_64              1:2.21-2.el8                                          ol8_baseos_latest               61 k
 perl-threads-shared                     x86_64              1.58-2.el8                                            ol8_baseos_latest               48 k
 protobuf-lite                           x86_64              3.5.0-7.el8                                           ol8_appstream                  150 k
Installing module profiles:
Enabling module streams:
 mysql                                                       8.0                                                                                       

Transaction Summary
Install  39 Packages

Total download size: 44 M
Installed size: 249 M
Is this ok [y/N]: y

You can confirm package details.

$ rpm -qi mysql-server 
Name        : mysql-server
Version     : 8.0.17
Release     : 3.module+el8.0.0+5253+1dce7bb2
Architecture: x86_64
Install Date: Fri 29 May 2020 10:36:33 PM UTC
Group       : Unspecified
Size        : 144963659
License     : GPLv2 with exceptions and LGPLv2 and BSD
Signature   : RSA/SHA256, Fri 16 Aug 2019 01:39:42 PM UTC, Key ID 82562ea9ad986da3
Source RPM  : mysql-8.0.17-3.module+el8.0.0+5253+1dce7bb2.src.rpm
Build Date  : Fri 16 Aug 2019 01:33:41 PM UTC
Build Host  :
Relocations : (not relocatable)
Vendor      : Oracle America
URL         :
Summary     : The MySQL server and related files

Step 3: Configure MySQL 8.0 on Oracle Linux 8

Start and enable mysql daemon service to start at system boot.

sudo systemctl enable --now mysqld

Service status query should return as running.

$ systemctl status mysqld
● mysqld.service - MySQL 8.0 database server
   Loaded: loaded (/usr/lib/systemd/system/mysqld.service; enabled; vendor preset: disabled)
   Active: active (running) since Fri 2020-05-29 22:40:19 UTC; 25s ago
  Process: 6612 ExecStartPost=/usr/libexec/mysql-check-upgrade (code=exited, status=0/SUCCESS)
  Process: 6485 ExecStartPre=/usr/libexec/mysql-prepare-db-dir mysqld.service (code=exited, status=0/SUCCESS)
  Process: 6461 ExecStartPre=/usr/libexec/mysql-check-socket (code=exited, status=0/SUCCESS)
 Main PID: 6569 (mysqld)
   Status: "Server is operational"
    Tasks: 39 (limit: 5047)
   Memory: 461.5M
   CGroup: /system.slice/mysqld.service
           └─6569 /usr/libexec/mysqld --basedir=/usr

Secure Database Server by:

  • Setting a secure root user password
  • Removing the anonymous users from the database
  • Disallow remote login as root user
  • Delete test database

Run the command below:

$ sudo mysql_secure_installation
Securing the MySQL server deployment.

Connecting to MySQL using a blank password.

VALIDATE PASSWORD COMPONENT can be used to test passwords
and improve security. It checks the strength of password
and allows the users to set only those passwords which are
secure enough. Would you like to setup VALIDATE PASSWORD component?

Press y|Y for Yes, any other key for No: y

There are three levels of password validation policy:

LOW    Length >= 8
MEDIUM Length >= 8, numeric, mixed case, and special characters
STRONG Length >= 8, numeric, mixed case, special characters and dictionary                  file

Please enter 0 = LOW, 1 = MEDIUM and 2 = STRONG: 2
Please set the password for root here.
New password: 

Re-enter new password: 

Estimated strength of the password: 100 
Do you wish to continue with the password provided?(Press y|Y for Yes, any other key for No) : y
By default, a MySQL installation has an anonymous user,
allowing anyone to log into MySQL without having to have
a user account created for them. This is intended only for
testing, and to make the installation go a bit smoother.
You should remove them before moving into a production

Remove anonymous users? (Press y|Y for Yes, any other key for No) : y

Normally, root should only be allowed to connect from
'localhost'. This ensures that someone cannot guess at
the root password from the network.

Disallow root login remotely? (Press y|Y for Yes, any other key for No) : y

By default, MySQL comes with a database named 'test' that
anyone can access. This is also intended only for testing,
and should be removed before moving into a production

Remove test database and access to it? (Press y|Y for Yes, any other key for No) : y
 - Dropping test database...

 - Removing privileges on test database...

Reloading the privilege tables will ensure that all changes
made so far will take effect immediately.

Reload privilege tables now? (Press y|Y for Yes, any other key for No) : y

All done!

Test that you can login successfully as root user:

$ mysql -u root -p
Enter password: <Enter-root-user-password>
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 10
Server version: 8.0.17 Source distribution

Copyright (c) 2000, 2019, Oracle and/or its affiliates. All rights reserved.

Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
mysql> QUIT

You now have a running MySQL 8 database running on Oracle Linux 8 system.

MySQL mastery courses:

in stock
in stock

Recommended MySQL Books:

SQL for Data Analytics: Perform fast and efficient data analysis with the power of SQL

$29.99  in stock
7 new from $29.99
2 used from $42.16
Free shipping
Buy Now
as of July 6, 2020 3:53 pm


Is Adult Product
Release Date2019-08-23T00:00:01Z
Number Of Pages386
Publication Date2019-08-23T00:00:01Z


Please enter your comment!
Please enter your name here

3 + fourteen =