Learn how to install MariaDB on Rocky Linux 8 with our straightforward guide. Follow step-by-step instructions to set up this MySQL fork, a powerful and reliable open-source relational database management system, on your Linux server. #centlinux #linux #mysql
Table of Contents
What is MariaDB?
MariaDB is an open-source relational database management system (RDBMS) and a drop-in replacement for MySQL. It was created by the original developers of MySQL due to concerns over Oracle’s acquisition of MySQL AB. MariaDB retains compatibility with MySQL while offering additional features, performance improvements, and enhanced security.
Key features of MariaDB include:
- Compatibility: MariaDB maintains compatibility with MySQL, ensuring that existing MySQL applications can easily transition to MariaDB without modification.
- Performance: MariaDB includes optimizations and enhancements that can improve database performance compared to MySQL, such as a new storage engine (Aria) and thread pooling.
- High Availability: MariaDB offers features like replication, clustering, and automatic failover to ensure high availability and reliability of database services.
- Security: MariaDB includes security enhancements such as database encryption, role-based access control (RBAC), and improved authentication mechanisms to protect data integrity and confidentiality.
- Scalability: MariaDB supports scalability through features like parallel replication, sharding, and multi-master replication, allowing it to handle large-scale deployments and high-volume workloads.
- Community-driven Development: MariaDB is developed and maintained by a vibrant community of contributors, ensuring ongoing development, support, and innovation.
Overall, MariaDB is a powerful and feature-rich alternative to MySQL, suitable for a wide range of applications from small-scale projects to large-scale enterprise deployments.
Recommended Online Training: Mastering SQL with MariaDB: An Essential Beginner’s Guide
Environment Specification
We are using a minimal Rocky Linux 8 virtual machine with following specifications.
- CPU – 3.4 Ghz (2 cores)
- Memory – 2 GB
- Storage – 20 GB
- Operating System – Rocky Linux 8.5 (Green Obsidian)
- Hostname – mariadb-01.centlinux.com
- IP Address – 192.168.116.128 /24
Update Your Rocky Linux Server
By using a SSH client, connect with your Linux server as root user.
Build yum cache of installed repositories.
# dnf makecache Rocky Linux 8 - AppStream 1.6 kB/s | 4.8 kB 00:02 Rocky Linux 8 - AppStream 737 kB/s | 9.7 MB 00:13 Rocky Linux 8 - BaseOS 3.3 kB/s | 4.3 kB 00:01 Rocky Linux 8 - BaseOS 566 kB/s | 6.8 MB 00:12 Rocky Linux 8 - Extras 1.2 kB/s | 3.5 kB 00:02 Metadata cache created.
Execute following command to update software packages in your Linux server.
# dnf update -y
Check the Linux Operating System and Kernel versions as follows.
# cat /etc/rocky-release && uname -r Rocky Linux release 8.5 (Green Obsidian) 4.18.0-348.20.1.el8_5.x86_64
Install MariaDB on Rocky Linux 8:
Get the list of MariaDB modules, that are available in standard yum repositories.
# dnf module list mariadb Last metadata expiration check: 0:02:47 ago on Mon 04 Apr 2022 08:05:18 PM PKT. Rocky Linux 8 - AppStream Name Stream Profiles Summary mariadb 10.3 [d] client, galera, server [d] MariaDB Module mariadb 10.5 client, galera, server [d] MariaDB Module Hint: [d]efault, [e]nabled, [x]disabled, [i]nstalled
You can see that, our required MariaDB Server 10.8 is not available in Rocky Linux yum repositories.
Therefore, you have to install MariaDB Official Repository on your Linux server.
Visit MariaDB Official website and select your Linux operating system to generate a yum repo for your machine.
Create a yum repo file by using vim text editor.
# vi /etc/yum.repos.d/MariaDB.repo
Copy and paste the generated yum repo into this file.
# MariaDB 10.8 [RC] CentOS repository list - created 2022-04-04 14:48 UTC # https://mariadb.org/download/ [mariadb] name = MariaDB baseurl = https://mirrors.gigenet.com/mariadb/yum/10.8/centos8-amd64 module_hotfixes=1 gpgkey=https://mirrors.gigenet.com/mariadb/yum/RPM-GPG-KEY-MariaDB gpgcheck=1 Save and exit.
Build cache for newly installed yum repositories.
# dnf makecache MariaDB 57 kB/s | 201 kB 00:03 Rocky Linux 8 - AppStream 3.5 kB/s | 4.8 kB 00:01 Rocky Linux 8 - BaseOS 2.3 kB/s | 4.3 kB 00:01 Rocky Linux 8 - Extras 2.6 kB/s | 3.5 kB 00:01 Metadata cache created.
Now you can install MariaDB on Rocky Linux by executing following Linux command.
# dnf install -y mariadb-server Last metadata expiration check: 0:01:05 ago on Mon 04 Apr 2022 08:10:04 PM PKT. Dependencies resolved. ================================================================================ Package Arch Version Repo Size ================================================================================ Installing: MariaDB-server x86_64 10.8.2-1.el8 mariadb 26 M Installing dependencies: MariaDB-client x86_64 10.8.2-1.el8 mariadb 15 M MariaDB-common x86_64 10.8.2-1.el8 mariadb 88 k MariaDB-shared x86_64 10.8.2-1.el8 mariadb 118 k boost-program-options x86_64 1.66.0-10.el8 appstream 140 k galera-4 x86_64 26.4.11-1.el8 mariadb 13 M libpmem x86_64 1.6.1-1.el8 appstream 78 k lsof x86_64 4.93.2-1.el8 baseos 252 k perl-Carp noarch 1.42-396.el8 baseos 29 k perl-DBI x86_64 1.641-3.module+el8.4.0+509+59a8d9b3 appstream 739 k perl-Data-Dumper x86_64 2.167-399.el8 baseos 57 k perl-Digest noarch 1.17-395.el8 appstream 26 k perl-Digest-MD5 x86_64 2.55-396.el8 appstream 36 k perl-Encode x86_64 4:2.97-3.el8 baseos 1.5 M perl-Errno x86_64 1.28-420.el8 baseos 75 k perl-Exporter noarch 5.72-396.el8 baseos 33 k perl-File-Path noarch 2.15-2.el8 baseos 37 k perl-File-Temp noarch 0.230.600-1.el8 baseos 62 k perl-Getopt-Long noarch 1:2.50-4.el8 baseos 62 k perl-HTTP-Tiny noarch 0.074-1.el8 baseos 57 k perl-IO x86_64 1.38-420.el8 baseos 141 k perl-MIME-Base64 x86_64 3.15-396.el8 baseos 30 k perl-Math-BigInt noarch 1:1.9998.11-7.el8 baseos 194 k perl-Math-Complex noarch 1.59-420.el8 baseos 107 k perl-Net-SSLeay x86_64 1.88-1.module+el8.4.0+512+d4f0fc54 appstream 378 k perl-PathTools x86_64 3.74-1.el8 baseos 89 k perl-Pod-Escapes noarch 1:1.07-395.el8 baseos 19 k perl-Pod-Perldoc noarch 3.28-396.el8 baseos 85 k perl-Pod-Simple noarch 1:3.35-395.el8 baseos 212 k perl-Pod-Usage noarch 4:1.69-395.el8 baseos 33 k perl-Scalar-List-Utils x86_64 3:1.49-2.el8 baseos 67 k perl-Socket x86_64 4:2.027-3.el8 baseos 58 k perl-Storable x86_64 1:3.11-3.el8 baseos 97 k perl-Term-ANSIColor noarch 4.06-396.el8 baseos 45 k perl-Term-Cap noarch 1.17-395.el8 baseos 22 k perl-Text-ParseWords noarch 3.30-395.el8 baseos 17 k perl-Text-Tabs+Wrap noarch 2013.0523-395.el8 baseos 23 k perl-Time-Local noarch 1:1.280-1.el8 baseos 32 k perl-URI noarch 1.73-3.el8 appstream 115 k perl-Unicode-Normalize x86_64 1.25-396.el8 baseos 81 k perl-constant noarch 1.33-396.el8 baseos 24 k perl-interpreter x86_64 4:5.26.3-420.el8 baseos 6.3 M perl-libnet noarch 3.11-3.el8 appstream 120 k perl-libs x86_64 4:5.26.3-420.el8 baseos 1.6 M perl-macros x86_64 4:5.26.3-420.el8 baseos 71 k perl-parent noarch 1:0.237-1.el8 baseos 19 k perl-podlators noarch 4.11-1.el8 baseos 117 k perl-threads x86_64 1:2.21-2.el8 baseos 60 k perl-threads-shared x86_64 1.58-2.el8 baseos 47 k rsync x86_64 3.1.3-12.el8 baseos 404 k socat x86_64 1.7.4.1-1.el8 appstream 322 k tar x86_64 2:1.30-5.el8 baseos 837 k Installing weak dependencies: perl-IO-Socket-IP noarch 0.39-5.el8 appstream 46 k perl-IO-Socket-SSL noarch 2.066-4.module+el8.4.0+512+d4f0fc54 appstream 297 k perl-Mozilla-CA noarch 20160104-7.module+el8.4.0+529+e3b3e624 appstream 14 k Enabling module streams: perl 5.26 perl-DBI 1.641 perl-IO-Socket-SSL 2.066 perl-libwww-perl 6.34 Transaction Summary ================================================================================ Install 55 Packages Total download size: 69 M Installed size: 303 M Downloading Packages: (1/55): MariaDB-common-10.8.2-1.el8.x86_64.rpm 58 kB/s | 88 kB 00:01 (2/55): MariaDB-shared-10.8.2-1.el8.x86_64.rpm 157 kB/s | 118 kB 00:00 (3/55): galera-4-26.4.11-1.el8.x86_64.rpm 478 kB/s | 13 MB 00:28 (4/55): MariaDB-client-10.8.2-1.el8.x86_64.rpm 472 kB/s | 15 MB 00:31 (5/55): boost-program-options-1.66.0-10.el8.x86 69 kB/s | 140 kB 00:02 (6/55): libpmem-1.6.1-1.el8.x86_64.rpm 48 kB/s | 78 kB 00:01 (7/55): perl-Digest-1.17-395.el8.noarch.rpm 97 kB/s | 26 kB 00:00 (8/55): perl-Digest-MD5-2.55-396.el8.x86_64.rpm 120 kB/s | 36 kB 00:00 (9/55): perl-DBI-1.641-3.module+el8.4.0+509+59a 542 kB/s | 739 kB 00:01 (10/55): perl-IO-Socket-IP-0.39-5.el8.noarch.rp 134 kB/s | 46 kB 00:00 (11/55): perl-IO-Socket-SSL-2.066-4.module+el8. 834 kB/s | 297 kB 00:00 (12/55): perl-Mozilla-CA-20160104-7.module+el8. 23 kB/s | 14 kB 00:00 (13/55): perl-Net-SSLeay-1.88-1.module+el8.4.0+ 945 kB/s | 378 kB 00:00 (14/55): perl-libnet-3.11-3.el8.noarch.rpm 335 kB/s | 120 kB 00:00 (15/55): socat-1.7.4.1-1.el8.x86_64.rpm 983 kB/s | 322 kB 00:00 (16/55): perl-URI-1.73-3.el8.noarch.rpm 124 kB/s | 115 kB 00:00 (17/55): perl-Carp-1.42-396.el8.noarch.rpm 26 kB/s | 29 kB 00:01 (18/55): perl-Data-Dumper-2.167-399.el8.x86_64. 108 kB/s | 57 kB 00:00 (19/55): lsof-4.93.2-1.el8.x86_64.rpm 136 kB/s | 252 kB 00:01 (20/55): perl-Errno-1.28-420.el8.x86_64.rpm 301 kB/s | 75 kB 00:00 (21/55): perl-Exporter-5.72-396.el8.noarch.rpm 145 kB/s | 33 kB 00:00 (22/55): perl-File-Path-2.15-2.el8.noarch.rpm 165 kB/s | 37 kB 00:00 (23/55): perl-File-Temp-0.230.600-1.el8.noarch. 270 kB/s | 62 kB 00:00 (24/55): perl-Getopt-Long-2.50-4.el8.noarch.rpm 213 kB/s | 62 kB 00:00 (25/55): perl-HTTP-Tiny-0.074-1.el8.noarch.rpm 250 kB/s | 57 kB 00:00 (26/55): perl-IO-1.38-420.el8.x86_64.rpm 529 kB/s | 141 kB 00:00 (27/55): perl-Encode-2.97-3.el8.x86_64.rpm 754 kB/s | 1.5 MB 00:01 (28/55): perl-MIME-Base64-3.15-396.el8.x86_64.r 127 kB/s | 30 kB 00:00 (29/55): perl-Math-BigInt-1.9998.11-7.el8.noarc 717 kB/s | 194 kB 00:00 (30/55): perl-Math-Complex-1.59-420.el8.noarch. 431 kB/s | 107 kB 00:00 (31/55): perl-PathTools-3.74-1.el8.x86_64.rpm 370 kB/s | 89 kB 00:00 (32/55): perl-Pod-Escapes-1.07-395.el8.noarch.r 88 kB/s | 19 kB 00:00 (33/55): perl-Pod-Perldoc-3.28-396.el8.noarch.r 361 kB/s | 85 kB 00:00 (34/55): perl-Pod-Simple-3.35-395.el8.noarch.rp 680 kB/s | 212 kB 00:00 (35/55): perl-Pod-Usage-1.69-395.el8.noarch.rpm 149 kB/s | 33 kB 00:00 (36/55): perl-Scalar-List-Utils-1.49-2.el8.x86_ 286 kB/s | 67 kB 00:00 (37/55): perl-Socket-2.027-3.el8.x86_64.rpm 249 kB/s | 58 kB 00:00 (38/55): perl-Storable-3.11-3.el8.x86_64.rpm 358 kB/s | 97 kB 00:00 (39/55): perl-Term-ANSIColor-4.06-396.el8.noarc 185 kB/s | 45 kB 00:00 (40/55): perl-Term-Cap-1.17-395.el8.noarch.rpm 99 kB/s | 22 kB 00:00 (41/55): perl-Text-ParseWords-3.30-395.el8.noar 76 kB/s | 17 kB 00:00 (42/55): perl-Text-Tabs+Wrap-2013.0523-395.el8. 96 kB/s | 23 kB 00:00 (43/55): perl-Time-Local-1.280-1.el8.noarch.rpm 121 kB/s | 32 kB 00:00 (44/55): perl-Unicode-Normalize-1.25-396.el8.x8 325 kB/s | 81 kB 00:00 (45/55): perl-constant-1.33-396.el8.noarch.rpm 104 kB/s | 24 kB 00:00 (46/55): perl-libs-5.26.3-420.el8.x86_64.rpm 698 kB/s | 1.6 MB 00:02 (47/55): perl-macros-5.26.3-420.el8.x86_64.rpm 271 kB/s | 71 kB 00:00 (48/55): perl-parent-0.237-1.el8.noarch.rpm 86 kB/s | 19 kB 00:00 (49/55): perl-podlators-4.11-1.el8.noarch.rpm 444 kB/s | 117 kB 00:00 (50/55): perl-threads-2.21-2.el8.x86_64.rpm 263 kB/s | 60 kB 00:00 (51/55): perl-threads-shared-1.58-2.el8.x86_64. 207 kB/s | 47 kB 00:00 (52/55): rsync-3.1.3-12.el8.x86_64.rpm 437 kB/s | 404 kB 00:00 (53/55): tar-1.30-5.el8.x86_64.rpm 612 kB/s | 837 kB 00:01 (54/55): perl-interpreter-5.26.3-420.el8.x86_64 470 kB/s | 6.3 MB 00:13 (55/55): MariaDB-server-10.8.2-1.el8.x86_64.rpm 138 kB/s | 26 MB 03:09 -------------------------------------------------------------------------------- Total 366 kB/s | 69 MB 03:12 MariaDB 6.0 kB/s | 8.2 kB 00:01 Importing GPG key 0x1BB943DB: Userid : "MariaDB Package Signing Key <package-signing-key@mariadb.org>" Fingerprint: 1993 69E5 404B D5FC 7D2F E43B CBCB 082A 1BB9 43DB From : https://mirrors.gigenet.com/mariadb/yum/RPM-GPG-KEY-MariaDB Key imported successfully Running transaction check Transaction check succeeded. Running transaction test Transaction test succeeded. Running transaction Preparing : 1/1 Running scriptlet: MariaDB-shared-10.8.2-1.el8.x86_64 1/55 Installing : MariaDB-shared-10.8.2-1.el8.x86_64 1/55 Running scriptlet: MariaDB-shared-10.8.2-1.el8.x86_64 1/55 Running scriptlet: MariaDB-common-10.8.2-1.el8.x86_64 2/55 Installing : MariaDB-common-10.8.2-1.el8.x86_64 2/55 Running scriptlet: MariaDB-common-10.8.2-1.el8.x86_64 2/55 Installing : rsync-3.1.3-12.el8.x86_64 3/55 Installing : lsof-4.93.2-1.el8.x86_64 4/55 Installing : libpmem-1.6.1-1.el8.x86_64 5/55 Running scriptlet: libpmem-1.6.1-1.el8.x86_64 5/55 Installing : perl-Digest-1.17-395.el8.noarch 6/55 Installing : perl-Digest-MD5-2.55-396.el8.x86_64 7/55 Installing : perl-Data-Dumper-2.167-399.el8.x86_64 8/55 Installing : perl-libnet-3.11-3.el8.noarch 9/55 Installing : perl-Net-SSLeay-1.88-1.module+el8.4.0+512+d4f0fc54 10/55 Installing : perl-URI-1.73-3.el8.noarch 11/55 Installing : perl-Pod-Escapes-1:1.07-395.el8.noarch 12/55 Installing : perl-Mozilla-CA-20160104-7.module+el8.4.0+529+e3b3 13/55 Installing : perl-IO-Socket-IP-0.39-5.el8.noarch 14/55 Installing : perl-Time-Local-1:1.280-1.el8.noarch 15/55 Installing : perl-IO-Socket-SSL-2.066-4.module+el8.4.0+512+d4f0 16/55 Installing : perl-Term-ANSIColor-4.06-396.el8.noarch 17/55 Installing : perl-Term-Cap-1.17-395.el8.noarch 18/55 Installing : perl-File-Temp-0.230.600-1.el8.noarch 19/55 Installing : perl-Pod-Simple-1:3.35-395.el8.noarch 20/55 Installing : perl-HTTP-Tiny-0.074-1.el8.noarch 21/55 Installing : perl-podlators-4.11-1.el8.noarch 22/55 Installing : perl-Pod-Perldoc-3.28-396.el8.noarch 23/55 Installing : perl-Text-ParseWords-3.30-395.el8.noarch 24/55 Installing : perl-Pod-Usage-4:1.69-395.el8.noarch 25/55 Installing : perl-MIME-Base64-3.15-396.el8.x86_64 26/55 Installing : perl-Storable-1:3.11-3.el8.x86_64 27/55 Installing : perl-Getopt-Long-1:2.50-4.el8.noarch 28/55 Installing : perl-Errno-1.28-420.el8.x86_64 29/55 Installing : perl-Socket-4:2.027-3.el8.x86_64 30/55 Installing : perl-Encode-4:2.97-3.el8.x86_64 31/55 Installing : perl-Carp-1.42-396.el8.noarch 32/55 Installing : perl-Exporter-5.72-396.el8.noarch 33/55 Installing : perl-libs-4:5.26.3-420.el8.x86_64 34/55 Installing : perl-Scalar-List-Utils-3:1.49-2.el8.x86_64 35/55 Installing : perl-parent-1:0.237-1.el8.noarch 36/55 Installing : perl-macros-4:5.26.3-420.el8.x86_64 37/55 Installing : perl-Text-Tabs+Wrap-2013.0523-395.el8.noarch 38/55 Installing : perl-Unicode-Normalize-1.25-396.el8.x86_64 39/55 Installing : perl-File-Path-2.15-2.el8.noarch 40/55 Installing : perl-IO-1.38-420.el8.x86_64 41/55 Installing : perl-PathTools-3.74-1.el8.x86_64 42/55 Installing : perl-constant-1.33-396.el8.noarch 43/55 Installing : perl-threads-1:2.21-2.el8.x86_64 44/55 Installing : perl-threads-shared-1.58-2.el8.x86_64 45/55 Installing : perl-interpreter-4:5.26.3-420.el8.x86_64 46/55 Installing : perl-Math-Complex-1.59-420.el8.noarch 47/55 Installing : perl-Math-BigInt-1:1.9998.11-7.el8.noarch 48/55 Installing : perl-DBI-1.641-3.module+el8.4.0+509+59a8d9b3.x86_6 49/55 Running scriptlet: MariaDB-client-10.8.2-1.el8.x86_64 50/55 Installing : MariaDB-client-10.8.2-1.el8.x86_64 50/55 Running scriptlet: MariaDB-client-10.8.2-1.el8.x86_64 50/55 Installing : tar-2:1.30-5.el8.x86_64 51/55 Running scriptlet: tar-2:1.30-5.el8.x86_64 51/55 Installing : socat-1.7.4.1-1.el8.x86_64 52/55 Installing : boost-program-options-1.66.0-10.el8.x86_64 53/55 Running scriptlet: boost-program-options-1.66.0-10.el8.x86_64 53/55 Running scriptlet: galera-4-26.4.11-1.el8.x86_64 54/55 Installing : galera-4-26.4.11-1.el8.x86_64 54/55 Running scriptlet: galera-4-26.4.11-1.el8.x86_64 54/55 Running scriptlet: MariaDB-server-10.8.2-1.el8.x86_64 55/55 Installing : MariaDB-server-10.8.2-1.el8.x86_64 55/55 Running scriptlet: MariaDB-server-10.8.2-1.el8.x86_64 55/55 Two all-privilege accounts were created. One is root@localhost, it has no password, but you need to be system 'root' user to connect. Use, for example, sudo mysql The second is mysql@localhost, it has no password either, but you need to be the system 'mysql' user to connect. After connecting you can set the password, if you would need to be able to connect as any of these users with a password and without sudo See the MariaDB Knowledgebase at https://mariadb.com/kb Please report any problems at https://mariadb.org/jira The latest information about MariaDB is available at https://mariadb.org/. Consider joining MariaDB's strong and vibrant community:Get InvolvedVerifying : MariaDB-client-10.8.2-1.el8.x86_64 1/55 Verifying : MariaDB-common-10.8.2-1.el8.x86_64 2/55 Verifying : MariaDB-server-10.8.2-1.el8.x86_64 3/55 Verifying : MariaDB-shared-10.8.2-1.el8.x86_64 4/55 Verifying : galera-4-26.4.11-1.el8.x86_64 5/55 Verifying : boost-program-options-1.66.0-10.el8.x86_64 6/55 Verifying : libpmem-1.6.1-1.el8.x86_64 7/55 Verifying : perl-DBI-1.641-3.module+el8.4.0+509+59a8d9b3.x86_6 8/55 Verifying : perl-Digest-1.17-395.el8.noarch 9/55 Verifying : perl-Digest-MD5-2.55-396.el8.x86_64 10/55 Verifying : perl-IO-Socket-IP-0.39-5.el8.noarch 11/55 Verifying : perl-IO-Socket-SSL-2.066-4.module+el8.4.0+512+d4f0 12/55 Verifying : perl-Mozilla-CA-20160104-7.module+el8.4.0+529+e3b3 13/55 Verifying : perl-Net-SSLeay-1.88-1.module+el8.4.0+512+d4f0fc54 14/55 Verifying : perl-URI-1.73-3.el8.noarch 15/55 Verifying : perl-libnet-3.11-3.el8.noarch 16/55 Verifying : socat-1.7.4.1-1.el8.x86_64 17/55 Verifying : lsof-4.93.2-1.el8.x86_64 18/55 Verifying : perl-Carp-1.42-396.el8.noarch 19/55 Verifying : perl-Data-Dumper-2.167-399.el8.x86_64 20/55 Verifying : perl-Encode-4:2.97-3.el8.x86_64 21/55 Verifying : perl-Errno-1.28-420.el8.x86_64 22/55 Verifying : perl-Exporter-5.72-396.el8.noarch 23/55 Verifying : perl-File-Path-2.15-2.el8.noarch 24/55 Verifying : perl-File-Temp-0.230.600-1.el8.noarch 25/55 Verifying : perl-Getopt-Long-1:2.50-4.el8.noarch 26/55 Verifying : perl-HTTP-Tiny-0.074-1.el8.noarch 27/55 Verifying : perl-IO-1.38-420.el8.x86_64 28/55 Verifying : perl-MIME-Base64-3.15-396.el8.x86_64 29/55 Verifying : perl-Math-BigInt-1:1.9998.11-7.el8.noarch 30/55 Verifying : perl-Math-Complex-1.59-420.el8.noarch 31/55 Verifying : perl-PathTools-3.74-1.el8.x86_64 32/55 Verifying : perl-Pod-Escapes-1:1.07-395.el8.noarch 33/55 Verifying : perl-Pod-Perldoc-3.28-396.el8.noarch 34/55 Verifying : perl-Pod-Simple-1:3.35-395.el8.noarch 35/55 Verifying : perl-Pod-Usage-4:1.69-395.el8.noarch 36/55 Verifying : perl-Scalar-List-Utils-3:1.49-2.el8.x86_64 37/55 Verifying : perl-Socket-4:2.027-3.el8.x86_64 38/55 Verifying : perl-Storable-1:3.11-3.el8.x86_64 39/55 Verifying : perl-Term-ANSIColor-4.06-396.el8.noarch 40/55 Verifying : perl-Term-Cap-1.17-395.el8.noarch 41/55 Verifying : perl-Text-ParseWords-3.30-395.el8.noarch 42/55 Verifying : perl-Text-Tabs+Wrap-2013.0523-395.el8.noarch 43/55 Verifying : perl-Time-Local-1:1.280-1.el8.noarch 44/55 Verifying : perl-Unicode-Normalize-1.25-396.el8.x86_64 45/55 Verifying : perl-constant-1.33-396.el8.noarch 46/55 Verifying : perl-interpreter-4:5.26.3-420.el8.x86_64 47/55 Verifying : perl-libs-4:5.26.3-420.el8.x86_64 48/55 Verifying : perl-macros-4:5.26.3-420.el8.x86_64 49/55 Verifying : perl-parent-1:0.237-1.el8.noarch 50/55 Verifying : perl-podlators-4.11-1.el8.noarch 51/55 Verifying : perl-threads-1:2.21-2.el8.x86_64 52/55 Verifying : perl-threads-shared-1.58-2.el8.x86_64 53/55 Verifying : rsync-3.1.3-12.el8.x86_64 54/55 Verifying : tar-2:1.30-5.el8.x86_64 55/55 Installed: MariaDB-client-10.8.2-1.el8.x86_64 MariaDB-common-10.8.2-1.el8.x86_64 MariaDB-server-10.8.2-1.el8.x86_64 MariaDB-shared-10.8.2-1.el8.x86_64 boost-program-options-1.66.0-10.el8.x86_64 galera-4-26.4.11-1.el8.x86_64 libpmem-1.6.1-1.el8.x86_64 lsof-4.93.2-1.el8.x86_64 perl-Carp-1.42-396.el8.noarch perl-DBI-1.641-3.module+el8.4.0+509+59a8d9b3.x86_64 perl-Data-Dumper-2.167-399.el8.x86_64 perl-Digest-1.17-395.el8.noarch perl-Digest-MD5-2.55-396.el8.x86_64 perl-Encode-4:2.97-3.el8.x86_64 perl-Errno-1.28-420.el8.x86_64 perl-Exporter-5.72-396.el8.noarch perl-File-Path-2.15-2.el8.noarch perl-File-Temp-0.230.600-1.el8.noarch perl-Getopt-Long-1:2.50-4.el8.noarch perl-HTTP-Tiny-0.074-1.el8.noarch perl-IO-1.38-420.el8.x86_64 perl-IO-Socket-IP-0.39-5.el8.noarch perl-IO-Socket-SSL-2.066-4.module+el8.4.0+512+d4f0fc54.noarch perl-MIME-Base64-3.15-396.el8.x86_64 perl-Math-BigInt-1:1.9998.11-7.el8.noarch perl-Math-Complex-1.59-420.el8.noarch perl-Mozilla-CA-20160104-7.module+el8.4.0+529+e3b3e624.noarch perl-Net-SSLeay-1.88-1.module+el8.4.0+512+d4f0fc54.x86_64 perl-PathTools-3.74-1.el8.x86_64 perl-Pod-Escapes-1:1.07-395.el8.noarch perl-Pod-Perldoc-3.28-396.el8.noarch perl-Pod-Simple-1:3.35-395.el8.noarch perl-Pod-Usage-4:1.69-395.el8.noarch perl-Scalar-List-Utils-3:1.49-2.el8.x86_64 perl-Socket-4:2.027-3.el8.x86_64 perl-Storable-1:3.11-3.el8.x86_64 perl-Term-ANSIColor-4.06-396.el8.noarch perl-Term-Cap-1.17-395.el8.noarch perl-Text-ParseWords-3.30-395.el8.noarch perl-Text-Tabs+Wrap-2013.0523-395.el8.noarch perl-Time-Local-1:1.280-1.el8.noarch perl-URI-1.73-3.el8.noarch perl-Unicode-Normalize-1.25-396.el8.x86_64 perl-constant-1.33-396.el8.noarch perl-interpreter-4:5.26.3-420.el8.x86_64 perl-libnet-3.11-3.el8.noarch perl-libs-4:5.26.3-420.el8.x86_64 perl-macros-4:5.26.3-420.el8.x86_64 perl-parent-1:0.237-1.el8.noarch perl-podlators-4.11-1.el8.noarch perl-threads-1:2.21-2.el8.x86_64 perl-threads-shared-1.58-2.el8.x86_64 rsync-3.1.3-12.el8.x86_64 socat-1.7.4.1-1.el8.x86_64 tar-2:1.30-5.el8.x86_64 Complete!
Enable and start MariaDB Service.
# systemctl enable --now mariadb.service Created symlink /etc/systemd/system/multi-user.target.wants/mariadb.service → /usr/lib/systemd/system/mariadb.service.
Check the status of MariaDB service.
# systemctl status mariadb.service
● mariadb.service - MariaDB 10.8.2 database server
Loaded: loaded (/usr/lib/systemd/system/mariadb.service; enabled; vendor pre>
Drop-In: /etc/systemd/system/mariadb.service.d
└─migrated-from-my.cnf-settings.conf
Active: active (running) since Mon 2022-04-04 20:18:03 PKT; 10min ago
Docs: man:mariadbd(8)
https://mariadb.com/kb/en/library/systemd/
Main PID: 4728 (mariadbd)
Status: "Taking your SQL requests now..."
Tasks: 8 (limit: 5808)
Memory: 261.1M
CGroup: /system.slice/mariadb.service
└─4728 /usr/sbin/mariadbd
Apr 04 20:18:03 mariadb-01.centlinux.com mariadbd[4728]: 2022-04-04 20:18:03 0 >
Apr 04 20:18:03 mariadb-01.centlinux.com mariadbd[4728]: 2022-04-04 20:18:03 0 >
Apr 04 20:18:03 mariadb-01.centlinux.com mariadbd[4728]: Version: '10.8.2-Maria>
Configure initial settings of your MariaDB server.
# mariadb-secure-installation NOTE: RUNNING ALL PARTS OF THIS SCRIPT IS RECOMMENDED FOR ALL MariaDB SERVERS IN PRODUCTION USE! PLEASE READ EACH STEP CAREFULLY! In order to log into MariaDB to secure it, we'll need the current password for the root user. If you've just installed MariaDB, and haven't set the root password yet, you should just press enter here. Enter current password for root (enter for none): OK, successfully used password, moving on... Setting the root password or using the unix_socket ensures that nobody can log into the MariaDB root user without the proper authorisation. You already have your root account protected, so you can safely answer 'n'. Switch to unix_socket authentication [Y/n] n ... skipping. You already have your root account protected, so you can safely answer 'n'. Change the root password? [Y/n] n ... skipping. By default, a MariaDB installation has an anonymous user, allowing anyone to log into MariaDB without having to have a user account created for them. This is intended only for testing, and to make the installation go a bit smoother. You should remove them before moving into a production environment. Remove anonymous users? [Y/n] Y ... Success! Normally, root should only be allowed to connect from 'localhost'. This ensures that someone cannot guess at the root password from the network. Disallow root login remotely? [Y/n] Y ... Success! By default, MariaDB comes with a database named 'test' that anyone can access. This is also intended only for testing, and should be removed before moving into a production environment. Remove test database and access to it? [Y/n] Y - Dropping test database... ... Success! - Removing privileges on test database... ... Success! Reloading the privilege tables will ensure that all changes made so far will take effect immediately. Reload privilege tables now? [Y/n] Y ... Success! Cleaning up... All done! If you've completed all of the above steps, your MariaDB installation should now be secure. Thanks for using MariaDB!
Connect to your MariaDB Server by using mysql command.
# mysql -u root -p Enter password: Welcome to the MariaDB monitor. Commands end with ; or g. Your MariaDB connection id is 9 Server version: 10.8.2-MariaDB MariaDB Server Copyright (c) 2000, 2018, Oracle, MariaDB Corporation Ab and others. Type 'help;' or 'h' for help. Type 'c' to clear the current input statement. MariaDB [(none)]> show databases; +--------------------+ | Database | +--------------------+ | information_schema | | mysql | | performance_schema | | sys | +--------------------+ 4 rows in set (0.071 sec) MariaDB [(none)]>
You have successfully install MariaDB on Rocky Linux operating system.
Configure Linux Firewall:
If you plan to access your MariaDB database server from network, then you have enable the MariaDB service in your Linux Firewall.
# firewall-cmd --permanent --add-service=mysql
success
# firewall-cmd --reload
success
For optimization of your MariaDB server, we strongly recommend that you should read High Performance MySQL: Proven Strategies for Operating at Scale 4th Edition (PAID LINK) by Silvia Botros and Jeremy Tinley.
Final Thoughts
Installing MariaDB on Rocky Linux 8 provides you with a robust and reliable open-source database management system for your server. With our comprehensive guide, you can easily set up MariaDB and leverage its powerful features to manage your data effectively.
If you require further assistance with installing MariaDB on Rocky Linux 8 or have any other Linux-related needs, I’m here to help! Check out my Fiverr profile here to explore the services I offer, including installation support, database configuration, optimization, and more. Let’s ensure your MariaDB deployment is smooth and efficient.