{"id":9130,"date":"2021-06-17T18:49:43","date_gmt":"2021-06-17T15:49:43","guid":{"rendered":"https:\/\/kifarunix.com\/?p=9130"},"modified":"2024-03-18T20:58:56","modified_gmt":"2024-03-18T17:58:56","slug":"install-mariadb-10-x-on-rocky-linux-8","status":"publish","type":"post","link":"https:\/\/kifarunix.com\/install-mariadb-10-x-on-rocky-linux-8\/","title":{"rendered":"Install MariaDB 10.x on Rocky Linux 8"},"content":{"rendered":"\n

This guide will take you through how to install MariaDB 10.x on Rocky Linux 8 system. As of this writing, MariaDB 10.5.10 is the current stable<\/strong> (GA) series of MariaDB based on MariaDB releases page<\/a>.<\/p>\n\n\n\n

You can read more about MariaDB 10.5 on its release notes<\/a> page.<\/p>\n\n\n\n

Installing MariaDB 10.x on Rocky Linux 8<\/h2>\n\n\n\n

The default Rocky Linux 8 AppStream repos provides MariadDB 10.3 (As of this writing).<\/p>\n\n\n\n

Therefore, if you need to install say, the latest stable release version of MariaDB, 10.5.10, on Rocky Linux, then you have to install MariaDB YUM repos.<\/p>\n\n\n\n

Install MariaDB 10.x YUM Repository on Rocky Linux<\/h3>\n\n\n\n

To install MariaDB 10.5.10, for instance, you need to install MariaDB YUM repository.<\/p>\n\n\n\n

cat << EOL > \/etc\/yum.repos.d\/mariadb.repo\n[mariadb]\nname = MariaDB\nbaseurl = http:\/\/yum.mariadb.org\/10.5\/rhel8-amd64\ngpgkey=https:\/\/yum.mariadb.org\/RPM-GPG-KEY-MariaDB\ngpgcheck=1\nmodule_hotfixes=1\nEOL<\/code><\/pre>\n\n\n\n

Next, install MariaDB YUM repository signing key.<\/p>\n\n\n\n

rpm --import https:\/\/yum.mariadb.org\/RPM-GPG-KEY-MariaDB<\/code><\/pre>\n\n\n\n

Install MariaDB 10.x<\/h3>\n\n\n\n

To install MariaDB 10.4 from the repos created above, simply run the command below;<\/p>\n\n\n\n

dnf install MariaDB-server MariaDB-client<\/code><\/pre>\n\n\n\n

Running MariaDB on Rocky Linux 8<\/h3>\n\n\n\n

To start MariaDB service;<\/p>\n\n\n\n

systemctl start mariadb<\/code><\/pre>\n\n\n\n

To enable MariaDB to run on system boot;<\/p>\n\n\n\n

systemctl enable mariadb<\/code><\/pre>\n\n\n\n

To check the status of MariaDB;<\/p>\n\n\n\n

systemctl status mariadb<\/code><\/pre>\n\n\n\n
\u25cf mariadb.service - MariaDB 10.5.10 database server\n   Loaded: loaded (\/usr\/lib\/systemd\/system\/mariadb.service; disabled; vendor preset: disabled)\n  Drop-In: \/etc\/systemd\/system\/mariadb.service.d\n           \u2514\u2500migrated-from-my.cnf-settings.conf\n   Active: active (running) since Thu 2021-06-17 13:53:58 EAT; 3min 48s ago\n     Docs: man:mariadbd(8)\n           https:\/\/mariadb.com\/kb\/en\/library\/systemd\/\n  Process: 47394 ExecStartPost=\/bin\/sh -c systemctl unset-environment _WSREP_START_POSITION (code=exited, status=0\/SUCCESS)\n  Process: 47369 ExecStartPre=\/bin\/sh -c [ ! -e \/usr\/bin\/galera_recovery ] && VAR= ||   VAR=`cd \/usr\/bin\/..; \/usr\/bin\/galera_recovery`; [ $? -eq 0 ]   && systemctl set-env>\n  Process: 47367 ExecStartPre=\/bin\/sh -c systemctl unset-environment _WSREP_START_POSITION (code=exited, status=0\/SUCCESS)\n Main PID: 47379 (mariadbd)\n   Status: \"Taking your SQL requests now...\"\n    Tasks: 9 (limit: 4938)\n   Memory: 103.8M\n   CGroup: \/system.slice\/mariadb.service\n           \u2514\u250047379 \/usr\/sbin\/mariadbd\n\nJun 17 13:53:56 localhost.localdomain mariadbd[47379]: 2021-06-17 13:53:56 0 [Note] InnoDB: 10.5.10 started; log sequence number 45118; transaction id 20\nJun 17 13:53:56 localhost.localdomain mariadbd[47379]: 2021-06-17 13:53:56 0 [Note] Plugin 'FEEDBACK' is disabled.\nJun 17 13:53:56 localhost.localdomain mariadbd[47379]: 2021-06-17 13:53:56 0 [Note] InnoDB: Loading buffer pool(s) from \/var\/lib\/mysql\/ib_buffer_pool\nJun 17 13:53:56 localhost.localdomain mariadbd[47379]: 2021-06-17 13:53:56 0 [Note] InnoDB: Buffer pool(s) load completed at 210617 13:53:56\nJun 17 13:53:56 localhost.localdomain mariadbd[47379]: 2021-06-17 13:53:56 0 [Note] Server socket created on IP: '::'.\nJun 17 13:53:58 localhost.localdomain mariadbd[47379]: 2021-06-17 13:53:58 0 [Note] Reading of all Master_info entries succeeded\nJun 17 13:53:58 localhost.localdomain mariadbd[47379]: 2021-06-17 13:53:58 0 [Note] Added new Master_info '' to hash table\nJun 17 13:53:58 localhost.localdomain mariadbd[47379]: 2021-06-17 13:53:58 0 [Note] \/usr\/sbin\/mariadbd: ready for connections.\nJun 17 13:53:58 localhost.localdomain mariadbd[47379]: Version: '10.5.10-MariaDB'  socket: '\/var\/lib\/mysql\/mysql.sock'  port: 3306  MariaDB Server\nJun 17 13:53:58 localhost.localdomain systemd[1]: Started MariaDB 10.5.10 database server.\n<\/code><\/pre>\n\n\n\n

Verify the MariaDB installed version.<\/p>\n\n\n\n

mysql -V<\/code><\/pre>\n\n\n\n
mysql  Ver 15.1 Distrib 10.5.10-MariaDB, for Linux (x86_64) using readline 5.1<\/code><\/pre>\n\n\n\n

Securing MariaDB<\/h3>\n\n\n\n

MariaDB comes with a default security script, mysql_secure_installation <\/code><\/strong>that is used to improve the security of MariaDB installation by:<\/p>\n\n\n\n