How to Install MySQL Database on Debian 10 Linux (Buster)

Debian 10 Linux (Buster) is the latest release of Debian-based Operating System which has a MariaDB as a default in their Repository. As we all know that MySQL is the widely used open-source RDMS (Relational Database Management System). In this post, we will see how to install MySQL Database on Debian 10 Linux (Buster) using MySQL official APT Repository. Let’s get started.

Prerequisites

Following are the prerequisites before you start installing MySQL Database on Debian 10 Linux Buster.
2. sudo privileges for non-root user

3. Firewall access to download packages.

4. Remove is MariaDB is already installed on your system
Step 1 – Add or Download MySQL APT Repository and install the MySQL APT Repository package which will manage, install and configure MySQL Software. 
$ cd tmp
$ wget https://dev.mysql.com/get/mysql-apt-config_0.8.15-1_all.deb
Step 2 – After Downloading the Package Install the package
$ sudo dpkg -i mysql-apt-config_0.8.15-1_all.deb
Note: MySQL 8.0 is pre-selected, if you want to install MySQL 5.7, select MySQL Server & Cluster (currently selected: mysql-8.0) and select your preferred MySQL version. Here, MySQL 8.0 is already selected, so we are going to select “OK” as shown below screenshot to continue.
Step 3Install MySQL 8.0

Update the latest package on your Debian system and install MySQL Server by running below command.

$ sudo apt update
$ sudo apt install mysql-server
Step 4 – You will be prompted to set MySQL root password. You can set the MySQL root password now else same can be done later on during MySQL Secure Installation also.
Re-enter root password

Next, you will be prompted to select Authentication Plugin and select “OK” to continue

MySQL Service will start automatically, once the installation is complete. Check the status of MySQL Service.
$ sudo systemctl status mysql

Step 5 – Securing MySQL
Run the following command from the console to set root password and secure other items. You will be asked series of YES or NO questions and it’s done.
$ sudo mysql_secure_installation


Step 6 – Testing MySQL
mysqladmin command line administrative client for MySQL. Below command to check the version of MySQL which we have installed.
$ sudo mysqladmin -u root -p version

Step 7 – Login into MySQL console
Execute below command to login into MySQL console.
That’s it. We have successfully installed MySQL Database on Debian 10 Linux Buster . Please share it with others and also Like Our Facebook Official Page.

 

Leave a Comment