RHEL8: Install and configure MariaDB

Create a seperate disk for db files, follow RHEL8: Configure datadisk

Verify updates

sudo dnf upgrade

Install mariadb server

sudo dnf install mariadb-server

Start, enable and check status of mariadb service

sudo systemctl start mariadb
sudo systemctl enable mariadb
sudo systemctl status mariadb

Configure mysql secure installation

mysql_secure_installation

Verify installation

mysqladmin -u root -p version

Allow remote access to mariadb server

Open firewallport for mariadb

sudo firewall-cmd --permanent --add-port=3306/tcp
sudo firewall-cmd --reload

Change bind-address in mariadb config file with server IP

sudo vi /etc/my.cnf.d/mariadb-server.cnf
bind-address=0.0.0.0

SELinux might block, Verify if SELinux is enabled

sestatus

To allow mysql connection through SELinux use command

setsebool -P selinuxuser_mysql_connect_enabled 1

Leave a Reply

Your email address will not be published.