Saturday, August 21, 2021

How To Install MariaDB 10.x on Debian 11


MariaDB is a fork of MySQL database and is developed as an open-source solution, primarily under the GPL license. It is a binary drop-in replacement of MySQL because it shares the same code base with MySQL 5.5 and later versions.

The MariaDB database is a free alternative to MySQL, and most of the enhancements are specifically aimed at high availability, scalability, and performance in data-intensive, business-critical applications. It can run on GNU/Linux, FreeBSD, Solaris, Mac OS X, Windows, and many other operating systems.

In this post, we will see how to install MariaDB on Debian 10.

Install MariaDB 10.x on Debian 11

You can obtain MariaDB packages for Debian 11 in two ways.
MariaDB mirror (MariaDB v10.6)Debian repository (MariaDB v10.5)
Install MariaDB from Official MariaDB Mirror

Update the repository index and install the required packages.
sudo apt update sudo apt install -y software-properties-common dirmngr apt-transport-https wget 

Add signing key to your system.
wget https://mariadb.org/mariadb_release_signing_key.asc gpg --no-default-keyring --keyring ./mariadb_release_signing_key_temp.gpg --import ./mariadb_release_signing_key.asc gpg --no-default-keyring --keyring ./mariadb_release_signing_key_temp.gpg --export > ./mariadb_release_signing_key.gpg sudo mv mariadb_release_signing_key.gpg /etc/apt/trusted.gpg.d/

MariaDB foundation offers a repository for Debian to install MariaDB easily. You can choose any one of the download mirrors from the MariaDB download page to set up the repository on your system.

Add MariaDB repository using the add-apt-repository command.
sudo add-apt-repository 'deb [arch=amd64,arm64,ppc64el] http://nyc2.mirrors.digitalocean.com/mariadb/repo/10.6/debian bullseye main'

Install MariaDB server and client using the following command.
sudo apt update sudo apt install -y mariadb-server mariadb-client

Install MariaDB from Debian Repository

Installing MariaDB from the Debian repository is a straightforward one. But, it may have a bit old version of MariaDB.
sudo apt update sudo apt install -y mariadb-server mariadb-client

Secure MariaDB Installation

The mysql_secure_installation command will secure the installation of MariaDB with the help of provided questions, such as DB root password, manage root remote login, remove anonymous users, and remove test database and access to it.

This command was introduced in version 5.0.3-beta and is helpful when configuring a new server or making changes to an existing MariaDB database server.
sudo mysql_secure_installation

Output:
NOTE: RUNNING ALL PARTS OF THIS SCRIPT IS RECOMMENDED FOR ALL MariaDB SERVERS IN PRODUCTION USE!  PLEASE READ EACH STEP CAREFULLY! In order to log into MariaDB to secure it, we'll need the current password for the root user. If you've just installed MariaDB, and haven't set the root password yet, you should just press enter here. Enter current password for root (enter for none):  
Sumber: disini

0 comments:

Post a Comment