How to Install and Configure MariaDB on Oracle Linux 8.8
- 00:29 cat /etc/os-release
- 00:46 yum -y install mariadb-server
- 01:15 systemctl enable mariadb
- 01:26 systemctl start mariadb
- 01:49 systemctl status mariadb
- 02:06 mysql_secure_installation
- 03:05 mysql -u root -p
- 03:27 create database test;
- 03:51 use test;
- 04:11 create table checklist (Sno int, Name varchar(20), version int);
- 04:26 insert into checklist values ('1' , 'Oracle', '8.5');
- 04:37 select * from checklist;
- 05:02 CREATE USER 'user1'@'localhost'IDENTIFIED BY '123456';
- 05:05 GRANT ALL PRIVILEGES ON test.* TO'user1'@localhost;
- 05:12 FLUSH PRIVILEGES;
- 05:24 exit
- 06:03 mysql -u user1 -p
To install and configure MariaDB on Oracle Linux 8.8
Introduction:
MariaDB is an open-source relational database management system (DBMS) that is a consistent drop-in replacement for the extensively used MySQL database technology.
Installation Procedure:
Step 1: Check the Oracle Linux Version by using the below command
[root@linuxhelp ~]# cat /etc/os-release
NAME="Oracle Linux Server"
VERSION="8.8"
ID="ol"
ID_LIKE="fedora"
VARIANT="Server"
VARIANT_ID="server"
VERSION_ID="8.8"
PLATFORM_ID="platform:el8"
PRETTY_NAME="Oracle Linux Server 8.8"
ANSI_COLOR="0;31"
CPE_NAME="cpe:/o:oracle:linux:8:8:server"
HOME_URL="https://linux.oracle.com/"
BUG_REPORT_URL="https://github.com/oracle/oracle-linux"
ORACLE_BUGZILLA_PRODUCT="Oracle Linux 8"
ORACLE_BUGZILLA_PRODUCT_VERSION=8.8
ORACLE_SUPPORT_PRODUCT="Oracle Linux"
ORACLE_SUPPORT_PRODUCT_VERSION=8.8
Step 2: Install MariaDB Server by using the below command
[root@linuxhelp ~]# yum -y install mariadb-server
Oracle Linux 8 BaseOS Latest (x86_64) 21 kB/s | 3.6 kB 00:00
Oracle Linux 8 BaseOS Latest (x86_64) 19 MB/s | 62 MB 00:03
Oracle Linux 8 Application Stream (x86_64) 24 kB/s | 3.9 kB 00:00
Oracle Linux 8 Application Stream (x86_64) 21 MB/s | 48 MB 00:02
Latest Unbreakable Enterprise Kernel Release 7 18 kB/s | 3.0 kB 00:00
Dependencies resolved.
================================================================================
Package Arch Version Repository Size
================================================================================
Installing:
mariadb-server x86_64 3:10.3.35-1.module+el8.6.0+20730+e6b28fc7
ol8_appstream 16 M
Installing dependencies:
mariadb x86_64 3:10.3.35-1.module+el8.6.0+20730+e6b28fc7
ol8_appstream 6.0 M
mariadb-common x86_64 3:10.3.35-1.module+el8.6.0+20730+e6b28fc7
ol8_appstream 64 k
mariadb-connector-c x86_64 3.1.11-2.el8_3 ol8_appstream 200 k
mariadb-connector-c-config noarch 3.1.11-2.el8_3 ol8_appstream 15 k
mariadb-errmsg x86_64 3:10.3.35-1.module+el8.6.0+20730+e6b28fc7
ol8_appstream 235 k
perl-DBD-MySQL x86_64 4.046-3.module+el8.1.0+5427+61a5d536
ol8_appstream 156 k
Installing weak dependencies:
mariadb-backup x86_64 3:10.3.35-1.module+el8.6.0+20730+e6b28fc7
ol8_appstream 6.1 M
mariadb-gssapi-server x86_64 3:10.3.35-1.module+el8.6.0+20730+e6b28fc7
ol8_appstream 52 k
mariadb-server-utils x86_64 3:10.3.35-1.module+el8.6.0+20730+e6b28fc7
ol8_appstream 1.1 M
Enabling module streams:
mariadb 10.3
perl-DBD-MySQL 4.046
Transaction Summary
================================================================================
Install 10 Packages
Total download size: 30 M
Installed size: 154 M
Downloading Packages:
(1/10): mariadb-common-10.3.35-1.module+el8.6.0 345 kB/s | 64 kB 00:00
(2/10): mariadb-connector-c-3.1.11-2.el8_3.x86_ 2.0 MB/s | 200 kB 00:00
(3/10): mariadb-connector-c-config-3.1.11-2.el8 359 kB/s | 15 kB 00:00
(4/10): mariadb-errmsg-10.3.35-1.module+el8.6.0 2.7 MB/s | 235 kB 00:00
(5/10): mariadb-gssapi-server-10.3.35-1.module+ 1.6 MB/s | 52 kB 00:00
(6/10): mariadb-backup-10.3.35-1.module+el8.6.0 6.8 MB/s | 6.1 MB 00:00
(7/10): mariadb-10.3.35-1.module+el8.6.0+20730+ 6.1 MB/s | 6.0 MB 00:00
(8/10): perl-DBD-MySQL-4.046-3.module+el8.1.0+5 2.8 MB/s | 156 kB 00:00
(9/10): mariadb-server-utils-10.3.35-1.module+e 4.2 MB/s | 1.1 MB 00:00
(10/10): mariadb-server-10.3.35-1.module+el8.6. 12 MB/s | 16 MB 00:01
--------------------------------------------------------------------------------
Total 16 MB/s | 30 MB 00:01
Running transaction check
Transaction check succeeded.
Running transaction test
Transaction test succeeded.
Running transaction
Preparing : 1/1
Installing : mariadb-connector-c-config-3.1.11-2.el8_3.noarch 1/10
Installing : mariadb-common-3:10.3.35-1.module+el8.6.0+20730+e6 2/10
Installing : mariadb-errmsg-3:10.3.35-1.module+el8.6.0+20730+e6 3/10
Installing : perl-DBD-MySQL-4.046-3.module+el8.1.0+5427+61a5d53 4/10
Installing : mariadb-connector-c-3.1.11-2.el8_3.x86_64 5/10
Installing : mariadb-backup-3:10.3.35-1.module+el8.6.0+20730+e6 6/10
Installing : mariadb-gssapi-server-3:10.3.35-1.module+el8.6.0+2 7/10
Installing : mariadb-server-utils-3:10.3.35-1.module+el8.6.0+20 8/10
Running scriptlet: mariadb-server-3:10.3.35-1.module+el8.6.0+20730+e6 9/10
Installing : mariadb-server-3:10.3.35-1.module+el8.6.0+20730+e6 9/10
Running scriptlet: mariadb-server-3:10.3.35-1.module+el8.6.0+20730+e6 9/10
Installing : mariadb-3:10.3.35-1.module+el8.6.0+20730+e6b28fc7. 10/10
Running scriptlet: mariadb-3:10.3.35-1.module+el8.6.0+20730+e6b28fc7. 10/10
Verifying : mariadb-3:10.3.35-1.module+el8.6.0+20730+e6b28fc7. 1/10
Verifying : mariadb-backup-3:10.3.35-1.module+el8.6.0+20730+e6 2/10
Verifying : mariadb-common-3:10.3.35-1.module+el8.6.0+20730+e6 3/10
Verifying : mariadb-connector-c-3.1.11-2.el8_3.x86_64 4/10
Verifying : mariadb-connector-c-config-3.1.11-2.el8_3.noarch 5/10
Verifying : mariadb-errmsg-3:10.3.35-1.module+el8.6.0+20730+e6 6/10
Verifying : mariadb-gssapi-server-3:10.3.35-1.module+el8.6.0+2 7/10
Verifying : mariadb-server-3:10.3.35-1.module+el8.6.0+20730+e6 8/10
Verifying : mariadb-server-utils-3:10.3.35-1.module+el8.6.0+20 9/10
Verifying : perl-DBD-MySQL-4.046-3.module+el8.1.0+5427+61a5d53 10/10
Installed:
mariadb-3:10.3.35-1.module+el8.6.0+20730+e6b28fc7.x86_64
mariadb-backup-3:10.3.35-1.module+el8.6.0+20730+e6b28fc7.x86_64
mariadb-common-3:10.3.35-1.module+el8.6.0+20730+e6b28fc7.x86_64
mariadb-connector-c-3.1.11-2.el8_3.x86_64
mariadb-connector-c-config-3.1.11-2.el8_3.noarch
mariadb-errmsg-3:10.3.35-1.module+el8.6.0+20730+e6b28fc7.x86_64
mariadb-gssapi-server-3:10.3.35-1.module+el8.6.0+20730+e6b28fc7.x86_64
mariadb-server-3:10.3.35-1.module+el8.6.0+20730+e6b28fc7.x86_64
mariadb-server-utils-3:10.3.35-1.module+el8.6.0+20730+e6b28fc7.x86_64
perl-DBD-MySQL-4.046-3.module+el8.1.0+5427+61a5d536.x86_64
Complete!
Step 3: Enable the MariaDB service by using the below command
[root@linuxhelp ~]# systemctl enable mariadb
Created symlink /etc/systemd/system/mysql.service → /usr/lib/systemd/system/mariadb.service.
Created symlink /etc/systemd/system/mysqld.service → /usr/lib/systemd/system/mariadb.service.
Created symlink /etc/systemd/system/multi-user.target.wants/mariadb.service → /usr/lib/systemd/system/mariadb.service.
Step 4: Start the MariaDB service by using the below command
[root@linuxhelp ~]# systemctl start mariadb
Step 5: Check the status of MariaDB service by using the below command
[root@linuxhelp ~]# systemctl status mariadb
● mariadb.service - MariaDB 10.3 database server
Loaded: loaded (/usr/lib/systemd/system/mariadb.service; enabled; vendor pre>
Active: active (running) since Mon 2023-08-21 04:14:24 IST; 15s ago
Docs: man:mysqld(8)
https://mariadb.com/kb/en/library/systemd/
Process: 111469 ExecStartPost=/usr/libexec/mysql-check-upgrade (code=exited, >
Process: 111334 ExecStartPre=/usr/libexec/mysql-prepare-db-dir mariadb.servic>
Process: 111310 ExecStartPre=/usr/libexec/mysql-check-socket (code=exited, st>
Main PID: 111437 (mysqld)
Status: "Taking your SQL requests now..."
Tasks: 30 (limit: 10293)
Memory: 81.5M
CGroup: /system.slice/mariadb.service
└─111437 /usr/libexec/mysqld --basedir=/usr
Aug 21 04:14:24 linuxhelp mysql-prepare-db-dir[111376]: which will also give yo>
Aug 21 04:14:24 linuxhelp mysql-prepare-db-dir[111376]: databases and anonymous>
Aug 21 04:14:24 linuxhelp mysql-prepare-db-dir[111376]: strongly recommended fo>
Aug 21 04:14:24 linuxhelp mysql-prepare-db-dir[111376]: See the MariaDB Knowled>
Aug 21 04:14:24 linuxhelp mysql-prepare-db-dir[111376]: Please report any probl>
Aug 21 04:14:24 linuxhelp mysql-prepare-db-dir[111376]: The latest information >
Aug 21 04:14:24 linuxhelp mysql-prepare-db-dir[111376]: Consider joining MariaD>
Aug 21 04:14:24 linuxhelp mysql-prepare-db-dir[111376]: https://mariadb.org/get>
Step 6: Install MariaDB server by using the below command
[root@linuxhelp ~]# mysql_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
you haven't set the root password yet, the password will be blank,
so you should just press enter here.
Enter current password for root (enter for none):
OK, successfully used password, moving on...
Setting the root password ensures that nobody can log into the MariaDB
root user without the proper authorisation.
Set root password? [Y/n] y
New password:
Re-enter new 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!
Step 7: Login to the MariaDB database by using the below command
[root@linuxhelp ~]# mysql -u root -p
Enter password:
Welcome to the MariaDB monitor. Commands end with ; or \g.
Your MariaDB connection id is 17
Server version: 10.3.35-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)]>
Step 8: Create the sample database by using the below command
MariaDB [(none)]> create database test;
Query OK, 1 row affected (0.001 sec)
MariaDB [(none)]> show databases;
+--------------------+
| Database |
+--------------------+
| information_schema |
| mysql |
| performance_schema |
| test |
+--------------------+
4 rows in set (0.001 sec)
Step 9: Enter the database using the below command
MariaDB [(none)]> use test;
Database changed
Step 10: Create the table in the name of Checklist by using the below command
MariaDB [test]> create table checklist (Sno int, Name varchar(20), version int);
Query OK, 0 rows affected (0.005 sec)
Step 11: Insert the values inside the Tables by using the below commands.
MariaDB [test]> insert into checklist values ('1' , 'Oracle', '8.5');
Query OK, 1 row affected (0.002 sec)
Step 12: To list inside the table’s creation by using the below command.
MariaDB [test]> select * from checklist;
+------+--------+---------+
| Sno | Name | version |
+------+--------+---------+
| 1 | Oracle | 9 |
+------+--------+---------+
1 row in set (0.001 sec)
Step 13: To create a user and grant all privileges by using the below command
MariaDB [test]> CREATE USER 'user1'@'localhost'IDENTIFIED BY '123456';
Query OK, 0 rows affected (0.001 sec)
MariaDB [test]> GRANT ALL PRIVILEGES ON test.* TO'user1'@localhost;
Query OK, 0 rows affected (0.000 sec)
MariaDB [test]> FLUSH PRIVILEGES;
Query OK, 0 rows affected (0.000 sec)
MariaDB [test]> exit
Bye
Step 14: Login as user in MariaDB by the below command
[root@localhost]# mysql -u user1 -p
Enter password:
Welcome to the MariaDB monitor. Commands end with ; or \g.
Your MariaDB connection id is 17
Server version: 10.3.32-MariaDB MariaDB Server
MariaDB [(none)]> exit
Bye
Conclusion:
We have reached the end of this article. In this guide, we have walked you through the steps required to install and configure MariaDB on Oracle Linux 8.8. Your feedback is much welcome.
Comments ( 0 )
No comments available