CentOS6 MariaDB 설치

124.53.35.193 (토론)님의 2017년 5월 29일 (월) 20:29 판
리눅스 MariaDB 설치
CentOS MariaDB 설치

1 확인

[root@zetawiki ~]# rpm -qa | grep MariaDB
→ 설치 안됨

2 repo 설정

3 설치

[root@zetawiki ~]# yum install mariadb-server
... (생략)
===========================================================================================
 Package                     Arch         Version                      Repository     Size
===========================================================================================
Installing:
 MariaDB-compat              x86_64       10.1.18-1.el6                mariadb       2.7 M
     replacing  mysql-libs.x86_64 5.1.73-7.el6
 MariaDB-server              x86_64       10.1.18-1.el6                mariadb       104 M
Installing for dependencies:
 MariaDB-client              x86_64       10.1.18-1.el6                mariadb        40 M
 MariaDB-common              x86_64       10.1.18-1.el6                mariadb        42 k
 galera                      x86_64       25.3.18-1.rhel6.el6          mariadb       8.5 M
 jemalloc                    x86_64       3.6.0-1.el6                  epel          100 k
 lsof                        x86_64       4.82-5.el6                   base          324 k
 perl                        x86_64       4:5.10.1-141.el6_7.1         base           10 M
 perl-DBI                    x86_64       1.609-4.el6                  base          705 k
 perl-Module-Pluggable       x86_64       1:3.90-141.el6_7.1           base           40 k
 perl-Pod-Escapes            x86_64       1:1.04-141.el6_7.1           base           33 k
 perl-Pod-Simple             x86_64       1:3.13-141.el6_7.1           base          213 k
 perl-libs                   x86_64       4:5.10.1-141.el6_7.1         base          579 k
 perl-version                x86_64       3:0.77-141.el6_7.1           base           52 k
 rsync                       x86_64       3.0.6-12.el6                 base          335 k

Transaction Summary
===========================================================================================
Install      15 Package(s)

Total download size: 168 M
Is this ok [y/N]: y
... (생략)
PLEASE REMEMBER TO SET A PASSWORD FOR THE MariaDB root USER !
To do so, start the server, then issue the following commands:

'/usr/bin/mysqladmin' -u root password 'new-password'
'/usr/bin/mysqladmin' -u root -h localhost.localdomain password 'new-password'

Alternatively you can run:
'/usr/bin/mysql_secure_installation'

which will also give you the option of removing the test
databases and anonymous user created by default.  This is
strongly recommended for production servers.

See the MariaDB Knowledgebase at http://mariadb.com/kb or the
MySQL manual for more instructions.

Please report any problems at http://mariadb.org/jira

The latest information about MariaDB is available at http://mariadb.org/.
You can find additional information about the MySQL part at:
http://dev.mysql.com
Support MariaDB development by buying support/new features from MariaDB
Corporation Ab. You can contact us about this at sales@mariadb.com.
Alternatively consider joining our community based development effort:
http://mariadb.com/kb/en/contributing-to-the-mariadb-project/

  Erasing    : mysql-libs-5.1.73-7.el6.x86_64                                        16/16 
  Verifying  : 1:perl-Pod-Escapes-1.04-141.el6_7.1.x86_64                             1/16 
  Verifying  : lsof-4.82-5.el6.x86_64                                                 2/16 
  Verifying  : rsync-3.0.6-12.el6.x86_64                                              3/16 
  Verifying  : galera-25.3.18-1.rhel6.el6.x86_64                                      4/16 
  Verifying  : 1:perl-Pod-Simple-3.13-141.el6_7.1.x86_64                              5/16 
  Verifying  : perl-DBI-1.609-4.el6.x86_64                                            6/16 
  Verifying  : MariaDB-client-10.1.18-1.el6.x86_64                                    7/16 
  Verifying  : 1:perl-Module-Pluggable-3.90-141.el6_7.1.x86_64                        8/16 
  Verifying  : jemalloc-3.6.0-1.el6.x86_64                                            9/16 
  Verifying  : MariaDB-server-10.1.18-1.el6.x86_64                                   10/16 
  Verifying  : MariaDB-common-10.1.18-1.el6.x86_64                                   11/16 
  Verifying  : 3:perl-version-0.77-141.el6_7.1.x86_64                                12/16 
  Verifying  : MariaDB-compat-10.1.18-1.el6.x86_64                                   13/16 
  Verifying  : 4:perl-libs-5.10.1-141.el6_7.1.x86_64                                 14/16 
  Verifying  : 4:perl-5.10.1-141.el6_7.1.x86_64                                      15/16 
  Verifying  : mysql-libs-5.1.73-7.el6.x86_64                                        16/16 

Installed:
  MariaDB-compat.x86_64 0:10.1.18-1.el6        MariaDB-server.x86_64 0:10.1.18-1.el6       

Dependency Installed:
  MariaDB-client.x86_64 0:10.1.18-1.el6                                                    
  MariaDB-common.x86_64 0:10.1.18-1.el6                                                    
  galera.x86_64 0:25.3.18-1.rhel6.el6                                                      
  jemalloc.x86_64 0:3.6.0-1.el6                                                            
  lsof.x86_64 0:4.82-5.el6                                                                 
  perl.x86_64 4:5.10.1-141.el6_7.1                                                         
  perl-DBI.x86_64 0:1.609-4.el6                                                            
  perl-Module-Pluggable.x86_64 1:3.90-141.el6_7.1                                          
  perl-Pod-Escapes.x86_64 1:1.04-141.el6_7.1                                               
  perl-Pod-Simple.x86_64 1:3.13-141.el6_7.1                                                
  perl-libs.x86_64 4:5.10.1-141.el6_7.1                                                    
  perl-version.x86_64 3:0.77-141.el6_7.1                                                   
  rsync.x86_64 0:3.0.6-12.el6                                                              

Replaced:
  mysql-libs.x86_64 0:5.1.73-7.el6                                                         

Complete!
→ DB를 실행하고 패스워드를 설정하라는 안내가 나온다.
→ 그런데 mysql 이라는 이름이 자꾸 보인다. (문제는 없다.)

4 확인 2

[root@zetawiki ~]# rpm -qa | grep MariaDB
MariaDB-common-10.1.18-1.el6.x86_64
MariaDB-client-10.1.18-1.el6.x86_64
MariaDB-compat-10.1.18-1.el6.x86_64
MariaDB-server-10.1.18-1.el6.x86_64

5 DB 시작 / 패스워드 변경

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

[root@zetawiki ~]# /etc/init.d/mysql start
Starting MySQL.161014 20:20:41 mysqld_safe Logging to '/var/lib/mysql/localhost.localdomain.err'.
. SUCCESS!
[root@zetawiki ~]# /usr/bin/mysqladmin -u root password 'P@ssw0rd'
[root@zetawiki ~]# netstat -anp | grep 3306
tcp        0      0 :::3306                     :::*                        LISTEN      3268/mysqld
서비스 등록도 mysql이란 이름으로 되어 있고, 포트도 3306, 데몬이름도 mysqld이다.

6 접속 확인

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

Copyright (c) 2000, 2016, 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 ~]#

7 부팅시 자동시작 설정

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

[root@zetawiki ~]# chkconfig mysql on
[root@zetawiki ~]# chkconfig --list mysql
mysql          	0:off	1:off	2:on	3:on	4:on	5:on	6:off

8 같이 보기

9 참고 자료

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