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.
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.
Confirm your root password.
Select the default authentication plugin.
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: