[CentOS] MariaDB 설치하기

반응형

MariaDB 설치하기

 

 

1. MariaDB yum repo 등록


vi /etc/yum.repos.d/MariaDB.repo 입력

 

[mariadb]
name = MariaDB
baseurl = http://yum.mariadb.org/10.4/centos7-amd64
gpgkey=https://yum.mariadb.org/RPM-GPG-KEY-MariaDB
gpgcheck=1

MariaDB 10.4 버전을 등록했다. 만약 다른 버전을 다운로드 받고 싶다면, beseurl안의 버전을 수정하면 된다.

 

모두 작업했으면 작업후 종료 esc - :wq 입력

 

 

 

2. MariaDB 설치하기


yum install MariaDB

정상적으로 설치가 진행된다면, 위와 같이 진행이 지속된다.

 

 

3. MariaDB 설치 확인하기


mariadb --version

 

 

4. MariaDB 실행 및 비밀번호 변경


설명 명령어
MariaDB 실행 # systemctl start mariadb
비밀번호 변경 # /usr/bin/mysqladmin -u root password '변경 할 비밀번호'
포트 및 데몬 이름 확인 netstat -anp|grep 3306

 

 

5. CharaterSet utf8mb4 변경


# vi /etc/my.cnf

 

[mysqld]
default_storage_engine=innodb

init-connect='SET NAMES utf8mb4'
lower_case_table_names=1
character-set-server=utf8mb4
collation-server=utf8mb4_unicode_ci


[client]
port=3306
default-character-set = utf8mb4

[mysqldump]
default-character-set = utf8mb4

[mysql]
default-character-set = utf8mb4

 

 

 

6. MariaDB 재시작


systemctl restart mariadb

 

7. MariaDB 로그인 및 utf8mb4 설정 변경 확인


mysql -u root -p

비밀번호 입력

 

 

 

show variables like 'c%';

 

 

- linux 리부팅 시 자동으로 실행되도록 설정


설명 명령어
자동 시작 systemctl enable mariadb
자동 시작 종료 systemctl is-enabled mariadb

 

 

8. MariaDB 설치가 원할하지 않을 경우


2022.02.08 - [Computer/기타] - [CentOS] GPG key retrieval failed: [Errno 14] curl#60

 

[CentOS] GPG key retrieval failed: [Errno 14] curl#60

[CentOS] GPG key retrieval failed: [Errno 14] curl#60 Error  MariaDB 설치 과정에서 Error가 발생하였다. 나의 짧은 지식으로 system date and time을 읽고서는 Linux 내의 시간과 현재 Window에서 출력되..

mollangpiu.tistory.com

CentOS가 버전이 오래되었을 경우, mariaDB의 설치가 원할하지 않을 수 있다.

반응형

댓글

Designed by JB FACTORY