Resources · April 29, 2021 0

How to install MySQL server on Debian 10

This article will focus on steps to install MySQL server (community version) on Debian 10 or other Debian-derived Linux as Ubuntu. You will need internet to download sources from MySQL APT Repository website.

Step 0. Preparation

# apt update && apt upgrade
# apt install gnupg
# wget https://dev.mysql.com/get/mysql-apt-config_0.8.17-1_all.deb
# sudo dpkg -i mysql-apt-config_0.8.17-1_all.deb

You will be prompted for choosing which product/version to use:

Choose “ok” and press Tab to <ok> and Enter.

Final preparation is to update MySQL server repository:

# apt update

Step 1. Installation of MySQL Server

Run this command to install:

# apt-get install mysql-community-server

You will be prompted for setting password:

If your MySQL clients use old version of libmysqlclient, you should choose the option Use Legacy Auth Method for backward compatible, in next screen:

Step 2. Using MySQL server

Now you can check MySQL server status, or restart MySQL server, or secure your MySQL server, with commands:

# systemctl status mysql.service
# systemctl restart mysql.service
# mysql_secure_installation

Notes:

Your MySQL server is using /etc/mysql/mysql.cnf to provide /etc/mysql/my.cnf (my.cnf) in auto mode.

You can check current version of MySQL APT Repository at the website https://dev.mysql.com/downloads/repo/apt/ if Step 0 shows any error about version.