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.22-1_all.deb
sudo apt install ./mysql-apt-config_0.8.22-1_all.deb
As Kali Linux is not officially supported version, choose the Debian Bullseye release.
Choose MySQL Server and Cluster.
For MySQL Product go with the default settings.
When done click <OK> and press <Enter> key to confirm version selection.
Confirm configured MySQL repository is working:
$ sudo apt update
Get:1 http://repo.mysql.com/apt/debian bullseye InRelease [12.9 kB]
Get:3 http://repo.mysql.com/apt/debian bullseye/mysql-8.0 Sources [941 B]
Get:4 http://repo.mysql.com/apt/debian bullseye/mysql-apt-config amd64 Packages [567 B]
Hit:5 http://ftp.halifax.rwth-aachen.de/kali kali-rolling InRelease
Get:6 http://repo.mysql.com/apt/debian bullseye/mysql-8.0 amd64 Packages [8404 B]
Get:8 http://repo.mysql.com/apt/debian bullseye/mysql-tools amd64 Packages [6753 B]
Fetched 40.5 kB in 2s (23.3 kB/s)
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
3 packages can be upgraded. Run 'apt list --upgradable' to see them.
Install MySQL 8.0 on Kali Linux 2022.x
Once the repo has been added, update apt index and install mysql-server:
sudo apt update
sudo apt install mysql-community-server
Agree to proceed with the installation by pressing y on your keyboard.
The following additional packages will be installed:
libmecab2 mecab-ipadic mecab-ipadic-utf8 mecab-utils mysql-client mysql-common mysql-community-client mysql-community-client-core mysql-community-client-plugins mysql-community-server-core
The following NEW packages will be installed:
libmecab2 mecab-ipadic mecab-ipadic-utf8 mecab-utils mysql-client mysql-community-client mysql-community-client-core mysql-community-client-plugins mysql-community-server
mysql-community-server-core
The following packages will be upgraded:
mysql-common
1 upgraded, 10 newly installed, 0 to remove and 2 not upgraded.
Need to get 35.7 MB of archives.
After this operation, 286 MB of additional disk space will be used.
Do you want to continue? [Y/n] y
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: disabled)
Active: active (running) since Wed 2022-02-16 10:24:12 EST; 3s ago
Docs: man:mysqld(8)
http://dev.mysql.com/doc/refman/en/using-systemd.html
Process: 9537 ExecStartPre=/usr/share/mysql-8.0/mysql-systemd-start pre (code=exited, status=0/SUCCESS)
Main PID: 9572 (mysqld)
Status: "Server is operational"
Tasks: 38 (limit: 4613)
Memory: 363.6M
CPU: 540ms
CGroup: /system.slice/mysql.service
└─9572 /usr/sbin/mysqld
Feb 16 10:24:11 kali systemd[1]: Starting MySQL Community Server...
Feb 16 10:24:12 kali 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:
$ mysql -u root -p
Enter password: <INPUT-SET-PASSWORD>
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 8
Server version: 8.0.28 MySQL Community Server - GPL
Copyright (c) 2000, 2022, Oracle and/or its affiliates.
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>
Create test database
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> DROP DATABASE test_db;
Query OK, 0 rows affected (0.00 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:
Best MySQL Udemy Video courses:
- The Ultimate MySQL Bootcamp: Go from SQL Beginner to Expert
- SQL – MySQL for Data Analytics and Business Intelligence
- MySQL, SQL and Stored Procedures from Beginner to Advanced
- SQL for Beginners: Learn SQL using MySQL and Database Design
- The Complete MySQL Developer Course
- MySQL Database Administration: Beginner SQL Database Design
- Learn Database Design with MySQL
You can also see below related Articles: