Skip to main content

Install MariaDB 10.6 on Oracle Linux 8|Rocky Linux 8

 

Install MariaDB 10.6 on Oracle

Linux 8|Rocky Linux 8

How can I quickly install MariaDB 10.6 on Oracle Linux 8 / Rocky Linux 8?. MariaDB is a free and open-source relational database management system forked from MySQL and community-developed. The database software is released under the GNU General Public License. Our short tutorial will teach you how to install and configure MariaDB 10.6 on Oracle Linux 8 | Rocky Linux 8 Linux system.

Install MariaDB 10.6 on Oracle Linux 8|Rocky Linux 8

You should have a running Oracle / Rocky Linux server before you start the installation. This can be a physical server, virtual machine running on VMware, KVM, OpenStack or cloud provider such as AWS. A user that has sudo privileges is also required for the installation.

Step 1: Update System

Run the command below to pull the latest packages of the applications installed in your system.

$ sudo dnf update
Transaction Summary
========================================================================================================================================================
Install   3 Packages
Upgrade  23 Packages

Total download size: 95 M
Is this ok [y/N]: y

If you get kernel updates, consider performing a reboot.

sudo reboot

Step 2: Add MariaDB repository

Add MariaDB repository to your Oracle Linux 8 / Rocky Linux 8.

curl -LsS -O https://downloads.mariadb.com/MariaDB/mariadb_repo_setup
sudo bash mariadb_repo_setup --mariadb-server-version=10.6

Or with a single command:

curl -LsS https://downloads.mariadb.com/MariaDB/mariadb_repo_setup | sudo bash -s -- --mariadb-server-version="mariadb-10.6"

Repository contents will be added to /etc/yum.repos.d/mariadb.repo file.

[info] Checking for script prerequisites.
[info] Repository file successfully written to /etc/yum.repos.d/mariadb.repo
[info] Adding trusted package signing keys...
/etc/pki/rpm-gpg ~
~
[info] Successfully added trusted package signing keys
[info] Cleaning package cache...
28 files removed

Step 3: Install MariaDB 10.6 on Oracle Linux 8 | Rocky Linux 8

Run the dnf command with install option to pull MariaDB packages on Oracle / Rocky Linux 8.

sudo dnf module reset mariadb -y
sudo yum install MariaDB-server MariaDB-client MariaDB-backup

Confirm the version being installed.

Transaction Summary
======================================================================================================================================================================================================
Install  55 Packages

Total download size: 74 M
Installed size: 321 M
Is this ok [y/N]: y

Start and enable mariadb service:

$ sudo systemctl enable --now mariadb
Created symlink /etc/systemd/system/multi-user.target.wants/mariadb.service → /usr/lib/systemd/system/mariadb.service.

Confirm service status is in running state.

$ systemctl status mariadb
 mariadb.service - MariaDB 10.6.4 database server
   Loaded: loaded (/usr/lib/systemd/system/mariadb.service; enabled; vendor preset: disabled)
  Drop-In: /etc/systemd/system/mariadb.service.d
           └─migrated-from-my.cnf-settings.conf
   Active: active (running) since Tue 2021-08-31 14:17:31 UTC; 14s ago
     Docs: man:mariadbd(8)
           https://mariadb.com/kb/en/library/systemd/
  Process: 16492 ExecStartPost=/bin/sh -c systemctl unset-environment _WSREP_START_POSITION (code=exited, status=0/SUCCESS)
  Process: 16469 ExecStartPre=/bin/sh -c [ ! -e /usr/bin/galera_recovery ] && VAR= ||   VAR=`cd /usr/bin/..; /usr/bin/galera_recovery`; [ $? -eq 0 ]   && systemctl set-environment _WSREP_START_POSI>
  Process: 16467 ExecStartPre=/bin/sh -c systemctl unset-environment _WSREP_START_POSITION (code=exited, status=0/SUCCESS)
 Main PID: 16479 (mariadbd)
   Status: "Taking your SQL requests now..."
    Tasks: 13 (limit: 23506)
   Memory: 66.5M
   CGroup: /system.slice/mariadb.service
           └─16479 /usr/sbin/mariadbd

Step 4: Secure MariaDB 10.6 on Oracle Linux 8 / Rocky Linux 8

Run the database hardening script to remove test database and set root password.

$ sudo 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): <ENTER>
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] y
Enabled successfully!
Reloading privilege tables..
 ... Success!


You already have your root account protected, so you can safely answer 'n'.

Change the root password? [Y/n]  y
New password: <INPUT-PASSWORD>
Re-enter new password: <CONFIRM-PASSWORD>
Password updated successfully!
Reloading privilege tables..
 ... Success!


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!

Login as root use to check if set password is working:

$ mysql -u root -p
Enter password:
Welcome to the MariaDB monitor.  Commands end with ; or \g.
Your MariaDB connection id is 24
Server version: 10.8.5-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)]> SELECT VERSION();
+----------------+
| VERSION()      |
+----------------+
| 10.8.5-MariaDB |
+----------------+
1 row in set (0.000 sec)

MariaDB [(none)]> \q
Bye

usefull links:

https://thinksystem.lenovofiles.com/storage/help/index.jsp?topic=%2FMCC-Tiebreaker_Software_Installation_and_Configuration_Guide%2F4B48FF53-C585-405B-9DCA-4D50F0080D5C_.html


Best MySQL Udemy Video courses:

Comments

Popular posts from this blog

Install MariaDB Latest Version 11.4 in Red Hat Version 9

 This this post i will show you step by step the installation process of mariaDB in red hat version 9. Step1 Run the command to pull the latest updated packages on applications installed in your system. -dnf update If you get Kernal update than reboot the system -reboot Step2 Go to official mariaDB site Make mariadb repository in /etc/yum.repos.d Place the configuration in this file # MariaDB 11.4 RedHatEnterpriseLinux repository list - created 2024-09-24 11:12 UTC # https://mariadb.org/download/ [mariadb] name = MariaDB # rpm.mariadb.org is a dynamic mirror if your preferred mirror goes offline. See https://mariadb.org/mirrorbits/ for details. # baseurl = https://rpm.mariadb.org/11.4/rhel/$releasever/$basearch baseurl = https://mirrors.aliyun.com/mariadb/yum/11.4/rhel/$releasever/$basearch # gpgkey = https://rpm.mariadb.org/RPM-GPG-KEY-MariaDB gpgkey = https://mirrors.aliyun.com/mariadb/yum/RPM-GPG-KEY-MariaDB gpgcheck = 1 Now install the mariaDB with its dependencies package...

Linux Commands

  Linux Commands 1.  OS-Release -cat /etc/os-release -cat /etc/redhat-release show os //kernal information -uname  show kernal middleware It is intermediator between hardware and software. -uname  -r what is process architect. -uname -p To show all information -uname -a 2.  Date-CAL -date -cal 3.  Booting in Linux (Run-Levels) Shutdown/Close pc -init 0  Single user mode -init 1 Multiple user mode -init 2 Multiple user mode with network plus full support Not use -init 4 Graphical mode init 5 Reboot the system -init 6 4.  Target command in Linux (systemctl) With the help of target we can manage system specific as well as user specific task. Target command is system Control (systemctl). Basically it is utility, which build to replace 'init' command. What systemctl can do ?  We can find its all commands with the help of single command. write systemctl enter twice TAB button. //it will list all its commands. Show current system mode - systemctl...