Tuesday 18 August 2020

How to Install MariaDB Database Server on CentOS 8




MariaDB is a popular open-source database and community-developed fork of MySQL. MariaDB database, It is widely used for database management in LAMP stack like servers.

This article describes, How to Install MariaDB Database Server on CentOS 8

Step 1. Package installation: Since MariaDB is available in CentOS 8 AppSream Repository so just run the following command to install to install MariaDB packages:

[root@linuxcnf ~]# dnf install @mariadb
Last metadata expiration check: 0:15:08 ago on Tue 18 Aug 2020 10:12:50 AM EDT.
…………………………………
Installed:
  mariadb-server-3:10.3.17-1.module_el8.1.0+257+48736ea6.x86_64
…………………………………
Complete!
[root@linuxcnf ~]#

Step 2. Start MariaDB Service: Run the following commands to start the server and enable on startup:

[root@linuxcnf ~]# systemctl enable --now mariadb
Created symlink /etc/systemd/system/mysql.service /usr/lib/systemd/system/mariadb.service.
Created symlink /etc/systemd/system/mysqld.service /usr/lib/systemd/system/mariadb.service.
Created symlink /etc/systemd/system/multi-user.target.wants/mariadb.service /usr/lib/systemd/system/mariadb.service.
[root@linuxcnf ~]#

Step 3. Verify the installation: Check the service status and check MariaDB database by access its interactive interface:

[root@linuxcnf ~]# systemctl status mariadb.service
mariadb.service - MariaDB 10.3 database server
   Loaded: loaded (/usr/lib/systemd/system/mariadb.service; enabled; vendor preset: disabled)
   Active: active (running) since Tue 2020-08-18 10:38:13 EDT; 1min 1s ago
     Docs: man:mysqld(8)
           https://mariadb.com/kb/en/library/systemd/
…………………….
Aug 18 10:38:13 linuxcnf systemd[1]: Started MariaDB 10.3 database server.
[root@linuxcnf ~]#

Run the following command to enter in MariaDB interface:

[root@linuxcnf ~]# mysql
Welcome to the MariaDB monitor.  Commands end with ; or \g.
Your MariaDB connection id is 8
Server version: 10.3.17-MariaDB MariaDB Server

Copyright (c) 2000, 2018, Oracle, MariaDB Corporation Ab and others.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

MariaDB [(none)]> \q
Bye
[root@linuxcnf ~]#

Done!!! MariaDB Database is installed successfully. Use \q command to exit from the interface.

No comments:

Post a Comment