Install MariaDB on RHEL 9
Step 1 – Install and secure
dnf install -y mariadb-server
systemctl enable --now mariadb
mysql_secure_installation
Step 2 – Create database and user
CREATE DATABASE appdb CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
CREATE USER 'appuser'@'localhost' IDENTIFIED BY 'StrongPass!';
GRANT ALL PRIVILEGES ON appdb.* TO 'appuser'@'localhost';
FLUSH PRIVILEGES;
Key /etc/my.cnf.d/mariadb-server.cnf settings
[mysqld]
innodb_buffer_pool_size = 1G
character-set-server = utf8mb4
collation-server = utf8mb4_unicode_ci