This tutorial will help you to install MySQL 8 on Ubuntu 20.04 LTS Focal Linux systems.


You must have a running Ubuntu 20.04 LTS system with sudo privileged account access. Next, login to your system and open a terminal. Run below commands to upgrade the current packages to the latest version.

Step 1 – Enable MySQL PPA

MySQL team provides official MySQL PPA for Ubuntu operating systems. You can download and install the package on your Ubuntu 18.04 system, which will add PPA file to your system. Run below command to enable PPA. The installer will prompt you to set default repository for the MySQL version. Make sure the MySQL-8 is set in currently selected. You can change this by navigating to line and press enter.

Once the properly version is selected move curser to last row “Ok” using keyboard up/down keys. Press enter to continue process. In case you select wrong version. Execute dpkg-reconfigure mysql-apt-config command after package installation to get this window again.

Step 2 – Installing MySQL 8 on Ubuntu

Your system is ready for the MySQL installation. Follow the below commands to install MySQL 8 on a Ubuntu 20.04 Linux system. The installation process will prompt for the root password to set as default. Input a secure password and same to confirm password window. This will be MySQL root user password required to log in to MySQL server.

Step 3 – Secure MySQL Installation

Execute the below command on your system to make security changes on your Database server. This will prompt some questions. The do the high security provide all answers to yes. Here you can enable/disable validate password plugin, Set required strength for passwords, remove anonymous users, disallow root login remotely, Remove test database and access to it and reload the reload privileges after applied changes. See the below output and action taken by me:

Step 4 – Connect to MySQL

The MySQL server has been installed on your system. Now connect to the MySQL database using the command line. Use root account password set in above step.


After completing this tutorial, You have installed MySQL 8 on Ubuntu 20.04 Linux system. Even you can access the MySQL from terminal, you can also install phpMyAdmin to work with it. The production users recommended to schedule database backup on a regular interval. This script will help you to schedule MySQL database backup and copy them to remote locations.

How to Install MySQL 8 0 on Ubuntu 20 04   TecAdmin - 22How to Install MySQL 8 0 on Ubuntu 20 04   TecAdmin - 97How to Install MySQL 8 0 on Ubuntu 20 04   TecAdmin - 88