MySQL 8 on Debian 10: Legacy Installation Guide
Legacy Debian 10 MySQL guide. Debian LTS ended in June 2024, and Oracle’s Buster repository still lists MySQL 8.0.33.
On this page
This page documents the former MySQL installation procedure for Debian 10 (Buster). Keep it only for reference when diagnosing existing legacy hosts.
Repository status: Do not use the Buster commands below for a new or production server. Oracle’s Buster MySQL 8.0 package index currently lists MySQL 8.0.33-1debian10, while MySQL 8.0 reached end of life with version 8.0.46 in April 2026. Debian 10 LTS also ended on June 30, 2024. These repositories do not provide a current MySQL maintenance release. For an existing MySQL 8.0 instance, see the MySQL 8.0 to 8.4 upgrade guide and plan to migrate the operating system to a supported release. For a new system, use our MySQL 9.7 LTS guide for Debian 13. See Debian’s LTS end-of-life notice and the MySQL 8.0 release notes.
Prerequisites
Before starting, make sure your Debian 10 server is up to date:
sudo apt update
sudo apt upgrade
Steps to Install MySQL
Step 1 - Add MySQL Repository
First, download and install the current MySQL APT repository configuration package. As of September 2026, the package is version 0.8.40-1:
sudo apt update
sudo apt install -y lsb-release wget
wget https://dev.mysql.com/get/mysql-apt-config_0.8.40-1_all.deb
sudo dpkg -i mysql-apt-config_0.8.40-1_all.deb
In the configuration dialog, select MySQL Server & Cluster, then choose the mysql-8.0 series. The MySQL repository currently publishes only this series for Debian 10 (Buster). See the MySQL APT repository download page and the repository guide.
Refresh APT’s package information after configuring the repository:
sudo apt update
Step 2 - Install MySQL
Now let’s install the MySQL server package:
sudo apt install mysql-server
During installation, you’ll be prompted to set a root password for MySQL.
Step 3 - Run Security Script
Once MySQL is installed, run the included security script. This will remove some default settings that are insecure:
sudo mysql_secure_installation
Follow the prompts to set a root password, remove anonymous users, disallow remote root login, and remove test databases.
Step 4 - Manage MySQL Service
To start, stop, restart or enable MySQL service to start on boot:
sudo systemctl start mysql
sudo systemctl stop mysql
sudo systemctl restart mysql
sudo systemctl enable mysql
MySQL is now installed and running!
Create a Database and User
Let’s create a test database and user to verify the installation.
First login with root:
sudo mysql -u root -p
Create a database:
CREATE DATABASE mytestdb;
Create a user with permissions:
-- MySQL 8.0.18+ returns a generated password; save it securely for the connection test.
CREATE USER 'myuser'@'localhost' IDENTIFIED BY RANDOM PASSWORD;
GRANT SELECT, INSERT, UPDATE, DELETE ON mytestdb.* TO 'myuser'@'localhost';
Exit MySQL shell:
exit
Connect to the new database with the user account:
mysql -u myuser -p mytestdb
Enter password when prompted.
Conclusion
This procedure can help maintain an existing Debian 10 installation, but it does not restore operating-system or MySQL 8.0 security support. Plan an upgrade to a supported Debian release and maintained MySQL LTS series before deploying a new application. For the database migration sequence, see the MySQL 8.0 to 8.4 upgrade guide; for current installs, see the Debian 13 MySQL 9.7 installation page and MySQL tutorials.
If you want to learn more about MySQL, please use our MySQL tutorials and MySQL Reference.