메뉴 건너뛰기

Korea Oracle User Group

DBMS

MariaDB How to Install MariaDB 10 on RHEL 8

명품관 2019.01.31 15:54 조회 수 : 250

How to Install MariaDB 10 on RHEL 8

 

MariaDB is a popular alternative to the MySQL database management system. It is developed by the original MySQL developers and is meant to remain open source.

MariaDB is fast and reliable, supports different storage engines and has plugins which makes it perfect for wide range of use cases.

In this tutorial we are going to show you how to install MariaDB server on your RHEL 8. We will be installing MariaDB 10.3.10 version.

Note: This tutorial presumes that you have an active RHEL 8 subscription and that you have root access to your RHEL system. Alternatively you can use a privileged user and run the commands with sudo.

Installing MariaDB Server

 

To install the MariaDB server, we will use the following yum command to complete the installation.

# yum install mariadb-server

This will install the MariaDB server and all the required dependencies.

Installing MariaDB in RHEL 8

Installing MariaDB in RHEL 8

Once the installation is complete, you can start the MariaDB service with:

# systemctl start mariadb

If you want to have the MariaDB service started automatically after each system boot, you can run the following command:

# systemctl enable mariadb

Verify the status of the MariaDB service with:

# systemctl status mariadb
Start MariaDB Service in RHEL 8

Start MariaDB Service in RHEL 8

Secure MariaDB Installation

Now that we have our service started, it is time to improve its security. We will setup root password, disable remote root login, remove test database and anonymous user. Finally we will reload all privileges.

For that purpose, simply run the following command and answer the questions accordingly:

# mysql_secure_installation

Note that the root user’s password is empty, so if you want to change it, simply press “enter”, when prompted for the current password. The rest you can follow the steps and answers on the image below:

Secure MariaDB Server in RHEL 8

Secure MariaDB Server in RHEL 8

Access the MariaDB Server

Let’s go a little deeper and create a database, user and give privileges to that user over the database. To access the server with console, you can use the following command:

# mysql -u root -p 

When prompted, enter the root password that you set earlier.

Now let’s create our database. For that purpose at the MariaDB prompt, run the following command:

MariaDB [(none)]> CREATE DATABASE tecmint; 

This will create new database named tecmint. Instead of accessing that database with our root user, we will create separate database user, that will have privileges to that database only.

We will create our new user called tecmint_user and grant it privileges on the tecmint database, with the following command:

MariaDB [(none)]> GRANT ALL ON tecmint.* TO tecmint_user@localhost IDENTIFIED BY 'securePassowrd';

When creating your own user, make sure to replace “securePassword” with the password you wish to give to that user.

When you have finished with the above commands, type “quit” at the prompt to exit MariaDB:

MariaDB [(none)]> quit;
Create Database in MariaDB

Create Database in MariaDB

Now you can use the new user to access the tecmint database.

# mysql -u tecmint_user -p 

When prompted enter the password for that user. To change the used database, you can use the following at the MariaDB prompt:

MariaDB [(none)]> use tecmint;

This will change the current database to tecmint.

Access MariaDB Database

Access MariaDB Database

Alternatively, you can issue the mysql command by specifying the database name as well as shown.

# mysql -u tecmint_user -p tecmint

That way when you enter the user’s password, you will directly be using the tecmint database.

Find Out More About MariaDB

Here you have learned some of the basics of MariaDB, but there is plenty more to explore. If you want to enhance your database knowledge you can checkout our guides here:

  1. Learn MySQL / MariaDB for Beginners – Part 1
  2. Learn MySQL / MariaDB for Beginners – Part 2
  3. MySQL Basic Database Administration Commands – Part III
  4. 20 MySQL (Mysqladmin) Commands for Database Administration – Part IV
  5. 15 Useful MariaDB Performance Tuning and Optimization Tips – Part V

This is it. In this tutorial, you learned how to install and secure MariaDB server and create your first database. If you have any questions, feel free to post them in the comment section.

 

번호 제목 글쓴이 날짜 조회 수
19 PostgreSQL 16 설치하기(Installation) [1] 명품관 2024.01.24 229
18 Top-Rated PostgreSQL GUI Clients for Windows 명품관 2023.05.10 87
17 기동시 "Job for mysqld.service failed because the control process exited with error code." 에러로 기동 실패 명품관 2020.09.03 7784
16 MySQL 8.0 Reference Manual - MySQL Server Administration2 - Server Configuration Validation 명품관 2020.04.17 413
15 MySQL 8.0 Reference Manual - MySQL Server Administration1 - Configuring the Server 명품관 2020.03.05 9593
14 MySQL 8.0 Reference Manual - Tutorial - Creating and Using a Database4 명품관 2020.03.03 251
13 MySQL 8.0 Reference Manual - Tutorial - Creating and Using a Database3 명품관 2020.03.02 400
12 Windows 버전 MySQL의 my.ini 파일 찾기 file 명품관 2020.03.01 13114
11 MySQL 8.0 Reference Manual - Tutorial - Creating and Using a Database2 명품관 2020.02.29 232
10 MySQL 8.0 Reference Manual - Tutorial - Creating and Using a Database1 명품관 2020.02.28 188
9 MySQL 8.0 Reference Manual - Tutorial - Entering Queries 명품관 2020.02.28 199
8 MySQL 8.0 Reference Manual - Tutorial - Connecting to and Disconnecting from the Server 명품관 2020.02.27 190
7 MySQL Admin - 01 명품관 2019.10.08 702
» How to Install MariaDB 10 on RHEL 8 [2] 명품관 2019.01.31 250
5 MySQL 설치 후 외부 접속 허용하기 명품관 2016.09.09 2839
4 CentOS 6.7 에서 MySQL 5.7 설치 명품관 2016.09.09 13784
3 티베로 trace log 중 ERROR_PSM_COMPILE_FAILED 에러란 명품관 2016.09.06 11368
2 DP, DPL, DPI에 관한trace log 내용 분석 명품관 2016.09.06 1019
1 티베로 에러 내용 확인 방법 명품관 2016.08.26 10716
위로