nuxt
flask
$
+
json
+
+
nest
+
play
torch
azure
+
//
+
<-
+
+
+
+
+
jwt
+
echo
java
+
+
rails
+
||
+
wasm
+
+
astro
backbone
+
pip
+
+
+
+
rollup
cosmos
zorin
+
rollup
+
+
dynamo
+
+
<=
+
stencil
+
+
+
nest
eclipse
windows
+
+
^
+
+
+
+
+
elixir
+
+
+
+
astro
flask
delphi
0b
+
++
chef
laravel
termux
zorin
+
+
ts
prettier
raspbian
Back to Blog
Installing and Configuring MariaDB on AlmaLinux
AlmaLinux Linux

Installing and Configuring MariaDB on AlmaLinux

Published Dec 17, 2023

Unlock the power of MariaDB on AlmaLinux! Follow our simple guide to install, configure, and secure MariaDB

2 min read
0 views
Table of Contents

MariaDB is a popular open-source relational database management system and a drop-in replacement for MySQL. This guide will walk you through installing and configuring MariaDB on AlmaLinux.

Prerequisites

Ensure you have root or sudo privileges. Before installation, update the package repository:

sudo dnf update -y

Installing MariaDB Prerequisites

Installing MariaDB from Package Manager

Run the MariaDB repository setup script:

wget https://downloads.mariadb.com/MariaDB/mariadb_repo_setup
chmod +x mariadb_repo_setup
sudo ./mariadb_repo_setup

Setting up MariaDB Repository

Use the package manager to install MariaDB:

sudo dnf install mariadb-server -y

Installing MariaDB Server

Start and Enable MariaDB

sudo systemctl start mariadb
sudo systemctl enable mariadb

Starting MariaDB Service

Secure MariaDB Server Installation

sudo mysql_secure_installation

This script prompts you to set the root password, remove anonymous users, restrict root login to local, and more.

MariaDB Security Installation

Accessing MariaDB

Log in to MariaDB with the root user:

sudo mariadb -u root -p

Accessing MariaDB

Creating a Database and User

Create a new database and user with appropriate privileges:

CREATE DATABASE krython_database;
CREATE USER 'krython_user'@'localhost' IDENTIFIED BY 'krython_password';
GRANT ALL PRIVILEGES ON krython_database.* TO 'krython_user'@'localhost';
FLUSH PRIVILEGES;

Replace krython_database, krython_user, and krython_password with your desired values.

Creating Database and User

Adjusting MariaDB Configuration

Edit the MariaDB configuration file to optimize performance:

sudo nano /etc/my.cnf.d/server.cnf

Add or modify parameters such as innodb_buffer_pool_size based on your system requirements.

Restarting MariaDB

After making changes, restart the MariaDB service:

sudo systemctl restart mariadb

Conclusion

Congratulations! You’ve successfully installed and configured MariaDB on AlmaLinux. Your database server is now ready for production use with proper security measures in place.