[목차]

1. MariaDB 설치 진행

2. MariaDB 기본 설정(DB 기동 중 진행해야 함. mariadb-secure-installation)


1. MariaDB 설치 진행

1) mariadb 홈페이지에서 다운받을 버전을 선택한다.

- 해당 포스팅에서는 10.6.15 버전을 다운로드 함

- https://mariadb.org/download/?t=repo-config에 방문하여, OS 및 버전 선택

2) repository 설정

- 홈페이지에 있는대로 repo 설정을 넣는다.

 

cd /etc/yum.repos.d

vi MariaDB.repo

# MariaDB 10.6 RedHatEnterpriseLinux repository list - created 2023-10-25 05:54 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/10.6/rhel/$releasever/$basearch
baseurl = https://tw1.mirror.blendbyte.net/mariadb/yum/10.6/rhel/$releasever/$basearch
module_hotfixes = 1
# gpgkey = https://rpm.mariadb.org/RPM-GPG-KEY-MariaDB
gpgkey = https://tw1.mirror.blendbyte.net/mariadb/yum/RPM-GPG-KEY-MariaDB
gpgcheck = 1


yum clean all
yum repolist all

 

3) yum 설치

- MariaDB 10.6.15 버전 설치되는것 확인

yum install MariaDB-server MariaDB-client

systemctl status  mariadb

 


2. MariaDB 기본 설정(DB 기동 중 진행해야 함. mariadb-secure-installation)

 

- mariadb-secure-installation 명령어 실행

mariadb-secure-installation

(중략)

Enter current password for root (enter for none):(엔터)
OK, successfully used password, moving on...

(중략)

Switch to unix_socket authentication [Y/n] y
Enabled successfully!
Reloading privilege tables..
 ... Success!

(중략)

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

(중략)

Remove anonymous users? [Y/n] y
 ... Success!

(중략)

Disallow root login remotely? [Y/n] y
 ... Success!

(중략)

Remove test database and access to it? [Y/n] y
 - Dropping test database...
 ... Success!
 - Removing privileges on test database...
 ... Success!

(중략)

Reload privilege tables now? [Y/n] y
 ... Success!

(중략)

- Mariadb 접속

mysql -u root -p
mariadb -u root -p <<< 이것도 가능


MariaDB [(none)]> status  <<<<< 상태 확인
--------------
mariadb  Ver 15.1 Distrib 10.6.15-MariaDB, for Linux (x86_64) using readline 5.1

Connection id:          15
Current database:
Current user:           root@localhost
SSL:                    Not in use
Current pager:          stdout
Using outfile:          ''
Using delimiter:        ;
Server:                 MariaDB
Server version:         10.6.15-MariaDB MariaDB Server
Protocol version:       10
Connection:             Localhost via UNIX socket
Server characterset:    latin1
Db     characterset:    latin1
Client characterset:    utf8mb3
Conn.  characterset:    utf8mb3
UNIX socket:            /var/lib/mysql/mysql.sock
Uptime:                 57 min 13 sec

Threads: 1  Questions: 30  Slow queries: 0  Opens: 21  Open tables: 14  Queries per second avg: 0.008

3. 

+ Recent posts