This article will help you to Install MariaDB 10.4 on Debian 9 (Stretch) via apt package manager.

Step 1 – Prerequsiteis

You can find the MariaDB Apt configuration file from the official website. Import the package singin key for MaraiDB packages on your system. After this, create a new Apt configuration file for MariaDB with the following command. You can use any text editor than vim.

Step 2 – Install MariaDB on Debian 9

After adding the repository to your system and use the following commands to install MariaDB-server on your Ubuntu system. This will remove any previous version of MariaDB packages and install the latest packages on the system. Make sure you have proper backups of databases before running the below commands. This will also install other required dependencies on your system. While installing MariaDB using above command installer will prompt for MariaDB root account password. Enter a strong password as below.

This will also ask for confirm password. Enter the same as above.

Step 3 – Verify MariaDB Setup

After the successful installation of MariaDB on the Debian 9 (Stretch) system. The installer will also start service during the install process. You can verify service by running the below command. MariaDB also creates a reference for service with name MySQL. You can change MariaDB with MySQL as per your choice. You will see the running status like:

Then connect to MariaDB shell by running below command. You need to enter the password configured in the above step.

Step 4 – Manage MariaDB Service

Sometimes you need to stop or start MariaDB service. Use the following commands to stop, start, check status and restart MariaDB service.

How To Install MariaDB on Debian 9  Stretch    TecAdmin - 11How To Install MariaDB on Debian 9  Stretch    TecAdmin - 85How To Install MariaDB on Debian 9  Stretch    TecAdmin - 85