Step-1: Prerequisites
1. root or sudo access
2. Internet access to download MariaDB and it’s repositories.
3. Port access if required. MariaDB default port is 3306
# MariaDB 10.4 CentOS repository list – created 2020-02-05 09:49 UTC
# http://downloads.mariadb.org/mariadb/repositories/
[mariadb]
name = MariaDB
baseurl = http://yum.mariadb.org/10.4/centos8-amd64
module_hotfixes=1
gpgkey=https://yum.mariadb.org/RPM-GPG-KEY-MariaDB
gpgcheck=1
For CentOS 7 (x86_64) Repository
# MariaDB 10.4 CentOS repository list – created 2020-02-05 09:56 UTC
# http://downloads.mariadb.org/mariadb/repositories/
[mariadb]
name = MariaDB
baseurl = http://yum.mariadb.org/10.4/centos7-amd64
gpgkey=https://yum.mariadb.org/RPM-GPG-KEY-MariaDB
gpgcheck=1
For RHEL 8 (x86_64) Repository
# MariaDB 10.4 RedHat repository list – created 2020-02-05 09:58 UTC
# http://downloads.mariadb.org/mariadb/repositories/
[mariadb]
name = MariaDB
baseurl = http://yum.mariadb.org/10.4/rhel8-amd64
module_hotfixes=1
gpgkey=https://yum.mariadb.org/RPM-GPG-KEY-MariaDB
gpgcheck=1
For RHEL 7 (x86_64) Repository
# MariaDB 10.4 RedHat repository list – created 2020-02-05 09:59 UTC
# http://downloads.mariadb.org/mariadb/repositories/
[mariadb]
name = MariaDB
baseurl = http://yum.mariadb.org/10.4/rhel7-ppc64
gpgkey=https://yum.mariadb.org/RPM-GPG-KEY-MariaDB
gpgcheck=1
Step-3: Create Repository file.
Insert into MariaDB.repo file For CentOS 8 (x86_64) Repository as shown above and save and exit from file.
# vi /etc/yum.repo.d/MariaDB.repo
Step-4: Install using YUM or DNF command.
# dnf install MariaDB-server
Step-5: Start MariaDB service
# systemctl start mariadb
# systemctl enable mariadb
# systemctl status mariadb
Step-6: Securing MariaDB Installation
# mysql_secure_installation
MariaDB comes with script to improve following securities. To start it execute command below. You will be prompted the followings:
1. Setting strong root password
2. Removing anonymous users
3. Disabling remote login for root user.
4. Removing test database and access to it
Note: MariaDB default password is BLANK (No Password)
Step-7: Connect MariaDB database with newly set password. Also check the version. Type exit command from MariaDB prompt to exit.
# mysql -u root -p
Installation Steps of MariaDB on Debian 10 Linux
Step-1: APT Repository
For Debian 10 “BUSTER” APT Repository. This will add entry in sources.list file under /etc/apt directory.
$ sudo apt-get install software-properties-common dirmngr
$ sudo apt-key adv –fetch-keys ‘https://mariadb.org/mariadb_release_signing_key.asc’
$ sudo add-apt-repository ‘deb [arch=amd64] http://mariadb.mirror.liteserver.nl/repo/10.4/debian buster main’
Step-2: Update your system
$ sudo apt update && sudo apt upgrade
Step-3: Install MariaDB on Debian 10 Linux
$ sudo apt install mariadb-server
Note: During installation it may ask for Debian 10 CD/DVD or ISO.
Mount ISO file as show below:
$ sudo mount -o loop -t iso9660 debian-10.2.0-amd64-DVD-1.iso /media/cdrom
Step-4: Check whether MariaDB database is installed.
$ sudo apt policy mariadb-server
Step-5: Securing MariaDB Database.
$ sudo mysql_secure_installation
Step-6: Check MariaDB Service if not start it.
# systemctl start mariadb
# systemctl enable mariadb
# systemctl status mariadb
Step-7: Login with MariaDB
Connect to MariaDB database with below command. Enter password set as above step-5.
# mysql -u root -p
Conclusion: In this tutorial, we have seen
Installation of MariaDB on CentOS, RedHat 8 and Debian 10 Linux. Big thanks for reading all the way to the end. Please share it with Your Friends & Help Someone… and also
Like Our Facebook Page. Let me hear your thoughts in the comments below! You may visit
MariaDB Website for Official Repository.