Since AlmaLinux has Red Hat Enterprise Linux binary compatibility, this free and open-source Linux OS distribution projects production-grade, and community-supported OS attributes.
These traits make AlmaLinux an ideal candidate for web-based applications. When it comes to the development and production of such applications, the need for an ideal and performant database management software is mandatory.
Installing MariaDB in AlmaLinux
An updated system is optimized for better performance and security patches fixes.
$ sudo dnf update && sudo dnf upgrade -y
Next, install MariaDB database management software on your AlmaLinux system by running the following command.
$ sudo dnf install mariadb-server -y
Once installed, confirm the MariaDB version with the following command:
$ mysql --version
Next, start and enable the MariaDB database server to keep running even after the computer hosting it restarts or gets a shutdown request and reboots afterward.
$ sudo systemctl start mariadb $ sudo systemctl enable mariadb $ sudo systemctl status mariadb
The latter command checks to ensure that your MariaDB database software is up and running.
Securing MariaDB in AlmaLinux
The following MySQL security script lets you set a root database user password, disallow remote login if necessary, and remove anonymous database users among other configurations.
$ sudo mysql_secure_installation
Access your MariaDB database with the new root user credentials you just created.
$ mysql -u root -p
Create a database user, database, and assign control over the created database to the user.
MariaDB [(none)]> CREATE USER linuxshelltips@localhost IDENTIFIED BY "Your_preferred_db_user_password"; MariaDB [(none)]> CREATE DATABASE linuxshelltips_db; MariaDB [(none)]> GRANT ALL ON linuxshelltips_db.* TO linuxshelltips@localhost; MariaDB [(none)]> FLUSH PRIVILEGES; MariaDB [(none)]> exit
This article guide has taken us through the installation and configuration of the MariaDB server on AlmaLinux. If database management was a missing piece in your web-based projects, you are now set to go.
Hi,
I’m new to AlmaLinux and MariaDB. I am moving from the defunct CentOS platform. Installing and setting up MariaDB, with the help of your tutorial was simple and saved me a lot of time.
I will return as questions come up. Thank you for providing a migration path away from CentOS. I selected MariaDB over MySQL because it’s possible that MySQL could go the way of CentOS and I don’t want that headache.
Thanks, again. Greg Steward