Database/설치
[MariaDB] CentOS7 환경에 MariaDB Database 설치하기
lv.COCO
2023. 3. 15. 11:12
1. https://mariadb.org/download 홈페이지 접속
2. 'MariaDB Repositories' - 환경에 맞는 버전 클릭
3. 'Mirror'는 자동생성
4. 아래의 설치 코드 복사
5. Repository 파일 생성 후 위 복사한 코드 입력
# vi /etc/yum.repos.d/MariaDB.repo
6. MariaDB 설치
# yum install MariaDB
Loaded plugins: fastestmirror, langpacks
Loading mirror speeds from cached hostfile
7. 설치 확인
--rpm 패키지 확인
[root@key ~]# rpm -qa | grep MariaDB
MariaDB-compat-10.4.28-1.el7.centos.x86_64
MariaDB-common-10.4.28-1.el7.centos.x86_64
MariaDB-server-10.4.28-1.el7.centos.x86_64
MariaDB-client-10.4.28-1.el7.centos.x86_64
--버전 확인
# mairadb -V
mariadb Ver 15.1 Distrib 10.4.26-MariaDB, for Linux (x86_64) using readline 5.1
8. mariaDB 시작
[root@key ~]# systemctl start mariadb
9. 패스워드 변경
[root@key ~]# /usr/bin/mysqladmin -u root password
New password:
Confirm new password:
10. 포트와 데몬 확인
[root@key ~]# netstat -anp | grep 3306
tcp6 0 0 :::3306 :::* LISTEN 3442/mysqld
11. MariaDB 접속 & DB 확인
[root@key ~]# mysql -u root -p
Enter password:
Welcome to the MariaDB monitor. Commands end with ; or \g.
Your MariaDB connection id is 9
Server version: 10.4.28-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)]> show databases;
+--------------------+
| Database |
+--------------------+
| information_schema |
| mysql |
| performance_schema |
| test |
+--------------------+
4 rows in set (0.002 sec)
MariaDB [(none)]>