CentOS7 MariaDB 설치

  다른 뜻에 대해서는 CentOS7 MariaDB 설치 문서를 참조하십시오.
  다른 뜻에 대해서는 우분투 MariaDB 설치 문서를 참조하십시오.
리눅스 MariaDB 설치
CentOS MariaDB 설치

1 repo 설정

[root@zabbix1 ~]# vi /etc/yum.repos.d/MariaDB.repo
[mariadb]
name = MariaDB
baseurl = http://yum.mariadb.org/10.1/centos7-amd64
gpgkey=https://yum.mariadb.org/RPM-GPG-KEY-MariaDB
gpgcheck=1

2 설치

===========================================================================================
 Package                     Arch       Version                          Repository   Size
===========================================================================================
Installing:
 MariaDB-client              x86_64     10.1.30-1.el7.centos             mariadb      39 M
 MariaDB-server              x86_64     10.1.30-1.el7.centos             mariadb     104 M
 MariaDB-shared              x86_64     10.1.30-1.el7.centos             mariadb     1.3 M
     replacing  mariadb-libs.x86_64 1:5.5.47-1.el7_2
Installing for dependencies:
 MariaDB-common              x86_64     10.1.30-1.el7.centos             mariadb     123 k
 boost-program-options       x86_64     1.53.0-27.el7                    base        156 k
 galera                      x86_64     25.3.22-1.rhel7.el7.centos       mariadb     8.0 M
 jemalloc                    x86_64     3.6.0-1.el7                      epel        105 k
 lsof                        x86_64     4.87-4.el7                       base        331 k
 perl-Compress-Raw-Bzip2     x86_64     2.061-3.el7                      base         32 k
 perl-Compress-Raw-Zlib      x86_64     1:2.061-4.el7                    base         57 k
 perl-DBI                    x86_64     1.627-4.el7                      base        802 k
 perl-Data-Dumper            x86_64     2.145-3.el7                      base         47 k
 perl-IO-Compress            noarch     2.061-2.el7                      base        260 k
 perl-Net-Daemon             noarch     0.48-5.el7                       base         51 k
 perl-PlRPC                  noarch     0.2020-14.el7                    base         36 k

Transaction Summary
===========================================================================================
Install  3 Packages (+12 Dependent packages)

Total download size: 155 M
Is this ok [y/d/N]: y
... (생략)
Installed:
  MariaDB-client.x86_64 0:10.1.30-1.el7.centos                                             
  MariaDB-server.x86_64 0:10.1.30-1.el7.centos                                             
  MariaDB-shared.x86_64 0:10.1.30-1.el7.centos                                             

Dependency Installed:
  MariaDB-common.x86_64 0:10.1.30-1.el7.centos                                             
  boost-program-options.x86_64 0:1.53.0-27.el7                                             
  galera.x86_64 0:25.3.22-1.rhel7.el7.centos                                               
  jemalloc.x86_64 0:3.6.0-1.el7                                                            
  lsof.x86_64 0:4.87-4.el7                                                                 
  perl-Compress-Raw-Bzip2.x86_64 0:2.061-3.el7                                             
  perl-Compress-Raw-Zlib.x86_64 1:2.061-4.el7                                              
  perl-DBI.x86_64 0:1.627-4.el7                                                            
  perl-Data-Dumper.x86_64 0:2.145-3.el7                                                    
  perl-IO-Compress.noarch 0:2.061-2.el7                                                    
  perl-Net-Daemon.noarch 0:0.48-5.el7                                                      
  perl-PlRPC.noarch 0:0.2020-14.el7                                                        

Replaced:
  mariadb-libs.x86_64 1:5.5.47-1.el7_2                                                     

Complete!

3 확인 2

[root@zetawiki ~]# rpm -qa | grep MariaDB
MariaDB-common-10.1.30-1.el7.centos.x86_64
MariaDB-server-10.1.30-1.el7.centos.x86_64
MariaDB-client-10.1.30-1.el7.centos.x86_64
MariaDB-shared-10.1.30-1.el7.centos.x86_64

4 DB 시작 / 패스워드 변경

아까 나왔던 안내대로 DB를 시작하고 패스워드를 바꾼다.

[root@zabbix1 ~]# systemctl start mariadb
[root@zetawiki ~]# /usr/bin/mysqladmin -u root password 'P@ssw0rd'
[root@zabbix1 ~]#
[root@zetawiki ~]# netstat -anp | grep 3306
tcp6       0      0 :::3306                 :::*                    LISTEN      3479/mysqld
포트는 3306, 데몬이름은 mysqld이다.

5 접속 확인

[root@zetawiki ~]# mysql -u root -p
Enter password: P@ssw0rd
Welcome to the MariaDB monitor.  Commands end with ; or \g.
Your MariaDB connection id is 5
Server version: 10.1.30-MariaDB MariaDB Server

Copyright (c) 2000, 2017, Oracle, MariaDB Corporation Ab and others.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

MariaDB [(none)]> quit
Bye
[root@zetawiki ~]#

6 부팅시 자동시작 설정 확인

기본으로 설정되어 있지만 한번 더 확인

[root@zabbix1 ~]# chkconfig --list mysql

Note: This output shows SysV services only and does not include native
      systemd services. SysV configuration data might be overridden by native
      systemd configuration.

      If you want to list systemd services use 'systemctl list-unit-files'.
      To see services enabled on particular target use
      'systemctl list-dependencies [target]'.

mysql          	0:off	1:off	2:on	3:on	4:on	5:on	6:off

7 같이 보기

8 참고

문서 댓글 ({{ doc_comments.length }})
{{ comment.name }} {{ comment.created | snstime }}