MySQL 8.0 is the latest stable release of MySQL relational database management system. MySQL is a free to use Database Management System (RDBMS) that uses Structured Query Language (SQL). MySQL is designed to be stable, reliable, and flexible to use.

We’ll use the available MySQL APT repository to install MySQL 8.0 on Kali Linux. Ensure this repository is added to your system by running the command below.

sudo apt update
sudo apt install -y wget
wget https://dev.mysql.com/get/mysql-apt-config_0.8.15-1_all.deb
sudo dpkg -i mysql-apt-config_0.8.15-1_all.deb

As Kali Linux is not officially supported version, choose the Ubuntu Bionic release.

<img alt="" data-ezsrc="https://kirelos.com/wp-content/uploads/2020/03/echo/install-mysql-8-kali-linux-01-1024×249.png" data-ez ezimgfmt="rs rscb8 src ng ngcb8 srcset" src="data:image/svg xml,”>

Select   and press  key to confirm version installation.

Install MySQL 8.0 on Kali Linux

Once the repo has been added, update apt index and install mysql-server:

sudo apt update
sudo apt install mysql-community-server

Accept license agreement in the next screens to begin installation.

Set root password for your MySQL database server.

<img alt="" data-ezsrc="https://kirelos.com/wp-content/uploads/2020/03/echo/install-mysql-8-kali-linux-02-1-1024×212.png" data-ez ezimgfmt="rs rscb8 src ng ngcb8 srcset" src="data:image/svg xml,”>

Confirm your root password.

<img alt="" data-ezsrc="https://kirelos.com/wp-content/uploads/2020/03/echo/install-mysql-8-kali-linux-03-1024×308.png" data-ez ezimgfmt="rs rscb8 src ng ngcb8 srcset" src="data:image/svg xml,”>

Select the default authentication plugin.

<img alt="" data-ezsrc="https://kirelos.com/wp-content/uploads/2020/03/echo/install-mysql-8-kali-linux-04-1-1024×311.png" data-ez ezimgfmt="rs rscb8 src ng ngcb8 srcset" src="data:image/svg xml,”>

When asked for root password, provide the password and confirm it to set.

sudo systemctl enable --now mysql

Check status using:

$ systemctl  status  mysql
 ● mysql.service - MySQL Community Server
    Loaded: loaded (/lib/systemd/system/mysql.service; enabled; vendor preset: enabled)
    Active: active (running) since Sat 2020-03-21 11:15:30 UTC; 2min 31s ago
      Docs: man:mysqld(8)
            http://dev.mysql.com/doc/refman/en/using-systemd.html
  Main PID: 2188 (mysqld)
    Status: "Server is operational"
     Tasks: 38 (limit: 2377)
    Memory: 386.5M
    CGroup: /system.slice/mysql.service
            └─2188 /usr/sbin/mysqld
 Mar 21 11:15:29 deb10 systemd[1]: Starting MySQL Community Server…
 Mar 21 11:15:30 deb10 systemd[1]: Started MySQL Community Server.

Test MySQL 8.0 Database Functionality

You can test if the database server is working fine by creating a test database:

$ sudo mysql -u root -p
Welcome to the MySQL monitor.  Commands end with ; or g.
Your MySQL connection id is 8
Server version: 8.0.19 MySQL Community Server - GPL
Copyright (c) 2000, 2020, 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 owners.
Type 'help;' or 'h' for help. Type 'c' to clear the current input statement.
mysql> 

mysql> CREATE DATABASE test_db;
Query OK, 1 row affected (0.01 sec)

mysql> SHOW DATABASES;
 -------------------- 
| Database           |
 -------------------- 
| information_schema |
| mysql              |
| performance_schema |
| sys                |
| test_db            |
 -------------------- 
5 rows in set (0.01 sec)
mysql> EXIT
Bye

Install Desktop Database Management Tool

If working with MySQL command line is not your thing, then consider installing a Database Tool to help you. Check out our guide below:

Install and Configure DBeaver on Ubuntu / Debian

You can also see below related Articles:

Install Metasploit Framework on Kali Linux 2020.x

Understanding the Linux File System Hierarchy