How to Setup MariaDB Database Server on AlmaLinux 8

a) Installing The MariaBD Server

Install the MariaDB Server.
sudo dnf module install mariadb

b) Enabling Autostart

To tell systemd to start mariadb service automatically at boot, enable it.
sudo systemctl enable mariadb.service

c) Starting

Start the mariadb.
sudo systemctl start mariadb.service
The database server will start listening on port 3306 by default.

d) Securing

You should improve the security of your MariaDB installation. So, run the command below and follow the upcoming instructions.
sudo mysql_secure_installation
It will ask you to:

  • change password of root account,
  • remove anonymous users,
  • disallow remote login of the root account,
  • remove test database and access to it,
  • reload privilege tables now, and more.

e) Usage

You can use the official command-line client mysql.
Additionally, you can use mysqlcheck, a command-line interface to the CHECK TABLE, REPAIR TABLE, ANALYZE TABLE and OPTIMIZE TABLE commands.
Find some officially supported graphical and enhanced clients here.


Next: How To Enable Remote Access To MariaDB Database Server On Red Hat Enterprise Linux 8


Documentations

Abdullah As-Sadeed

Abdullah As-Sadeed