How to Install MySQL on Ubuntu 20.04 Linux.

Hi Techies! Let’s learn about “How to install MySQL 8 on Ubuntu 20.04 Linux”, we will look at the  MySQL community edition server, installation step by step in Ubuntu 20.04.

MySQL is the Relation Database, which is used to store the data. It Is open-source and widely used in the industries.

MySQL written in C and C++. It has also been tested to be a “fast, stable and true multi-user, multi-threaded SQL database server”.


First, we will download the MySQL 8 Community Edition installer for Ubuntu 20.04 LTS.

how to install MySQL 8 in Ubuntu 20.04 Linux, we will look at the  MySQL community edition server installation step by step in Ubuntu 20.04.
Mysql Community Installer Page

Now right-click on “Download” and then select “Copy link address” and move to a terminal to download the bundle of MySQL 8.

So, now we will install wget in Ubuntu 20.04 to download the MySQL Packages.

In Ubuntu 20.04:

$ sudo apt install wget

The QUICK view to installing MySQL in Linux read the POST to get detailed knowledge about the installation.

Quick view to Install MySQL 8 on Ubuntu 20.04 LTS Linux

1: Download the Package of MySQL Community Edition in Ubuntu 20.04

$ wget https://downloads.mysql.com/archives/get/p/23/file/mysql-server_8.0.25-1ubuntu20.04_amd64.deb-bundle.tar

2: Extract the Package of MySQL 8 on Ubuntu 20.04

$ tar -xvf mysql-server_8.0.25-1ubuntu20.04_amd64.deb-bundle.tar

3: Install the Package of MySQL 8 using dpkg command on Ubuntu 20.04.

$ sudo dpkg -i *.deb
$ sudo apt-get install -f

4: Logged in and Check the Database of MySQL 8 in Ubuntu 20.04.

$ mysql -h localhost -u[username] -p[password]


Install MySQL 8 on Ubuntu 20.04 Step by Step

STEP 1: Download the MySQL Community Edition 8 Package in Ubuntu 20.04 to Install

$ wget https://downloads.mysql.com/archives/get/p/23/file/mysql-server_8.0.25-1ubuntu20.04_amd64.deb-bundle.tar

So here we have downloaded the bundle tar file for MySQL 8. you can check in the same directory by using the ls command.

STEP 2: Extract the Package of MySQL 8 on Ubuntu 20.04 LTS Linux

$ tar -xvf mysql-server_8.0.25-1ubuntu20.04_amd64.deb-bundle.tar

So with the help of the tar command, we have extracted the packages for MySQL 8, now we have to install all the deb packages for MySQL 8

STEP 3: Install the Package of MySQL 8 using the dpkg command in Ubuntu 20.04.

$ sudo dpkg -i *.deb

Once we start installing all the MySQL 8 deb package on Ubuntu 20.04, we will get some of the dependencies errors on the terminal.

$ sudo apt-get install -f

So, let’s install the dependencies by using the above command

how to install MySQL 8 in Ubuntu 20.04 Linux, we will look at the  MySQL community edition server installation step by step in Ubuntu 20.04.
Installing its dependencies packages.

It will ask for a password for the MySQL Community Server 8, which we are installing on Ubuntu 20.04.

how to install MySQL 8 in Ubuntu 20.04 Linux, we will look at the  MySQL community edition server installation step by step in Ubuntu 20.04.
1. Enter the Password

So, again re-enter the Password for MySQL 8

how to install MySQL 8 in Ubuntu 20.04 Linux, we will look at the  MySQL community edition server installation step by step in Ubuntu 20.04.
2. Re-enter the Password

So now let’s choose the Authentication Plugin, which has two methods the legacy authentication, also known as the OLD method, or keep the Strong Password Encryption.

how to install MySQL 8 in Ubuntu 20.04 Linux, we will look at the  MySQL community edition server installation step by step in Ubuntu 20.04.
3. Select the Authentication Methods
how to install MySQL 8 in Ubuntu 20.04 Linux, we will look at the  MySQL community edition server installation step by step in Ubuntu 20.04.
4. For the Authentication Methods

So select authentication methods and click on “OK” to Install MySQL 8 on Ubuntu 20.04.

STEP 4: Check the Version of MySQL in Ubuntu.

Let’s check the installed version of MySQL by –version option or log into the database to check the version.

$ mysql --version
$ mysql -h localhost -uUsername -pPassword

Create a Database on MySQL 8.

So, now let’s create the database on newly Installed MySQL 8 on Ubuntu 20.04

mysql> create database name_of_the_Database;

Example:
mysql> create database tastethelinux;

So, we have created a database named “tastethelinux” on MySQL 8 Ubuntu.

mysql>show databases;

We have used the “show databases” command to check the MySQL database that we have created.

We have successfully Install MySQL 8 on Ubuntu 20.04 if you want to check the POST to Install MySQL in Linux.

Install MySQL 8 in Rocky Linux. Thanks for reading the POST. Keep sharing and supporting us!


4 Replies to “How to Install MySQL on Ubuntu 20.04 Linux.

Give your valuable time