Installing MySQL 8.0 in Debian 11 Bullseye / Linux / Debian / Installing MySQL 8.0 in Debian 11 Bullseye

The MySQLB package is not included in the Debian 11 Bullseye repositories. The developers suggest using MariaDB instead. For some projects you need to use the original MySQL, not its fork. In that case you can manually add the MySQL repository and install the package in Debian. In my case, after upgrading the release from Debian 10 (Buster) to Debian 11 (Bullseye), I needed to install the original MySQL 8.0 on my Linux host.

First you need to update the packages on your Debian host:

sudo apt update

Using wget, download the desired version of MySQL APT Repository from the official MySQL website (


Install the MySQL apt repository:

sudo dpkg -i mysql-apt-config_0.8.22-1_all.deb

On a clean Debian install, you will most likely need to install gnupg:

apt-get install gnupg

You will see the MySQL apt repository add wizard (mysql-apt-config). Here you can select MySQL version and its parameters. In my case, I chose Mysql Server and Cluster (currently selected: mysql-8.0), MySQL Tools & Connectors – Enabled. MySQL Preview Packages – Disabled.

debian install mysql apt repo

After adding the MySQL repository, update the list of repos, and check if the mysql repository for bullseye is listed (/etc/apt/source.list.d/).

mysql 8.0 repository on debian 11

Update the package list:

apt-get update

Now you can install MySQL 8:

apt-get install mysql-server

During installation, you must specify the MySQL root password. It is also recommended to select the Strong Password Encryption authentication plugin.

To quickly configure typical MySQL security settings, run the mysql_secure_installation script.

Check that the MySQL service is running:

systemctl status mysql

Add the service to startup:

systemctl enable mysql

Now you can connect to MySQL:

mysql -u root -p
Leave a Reply

Your email address will not be published. Required fields are marked *