"CentOS6 MariaDB 설치"의 두 판 사이의 차이

잔글 (봇: 자동으로 텍스트 교체 (-</source> +</syntaxhighlight>, -<source +<syntaxhighlight ))
 
(사용자 7명의 중간 판 27개는 보이지 않습니다)
1번째 줄: 1번째 줄:
;MariaDB 설치
{{다른뜻|CentOS7 MariaDB 설치}}
{{다른뜻|우분투 MariaDB 설치}}
;리눅스 MariaDB 설치
;CentOS MariaDB 설치  


==확인==
==확인==
<source lang='dos'>
<syntaxhighlight lang='console'>
[root@jmnote ~]# rpm -qa | grep MariaDB
[root@zetawiki ~]# rpm -qa | grep MariaDB
</source>
</syntaxhighlight>
:→ 설치 안됨
:→ 설치 안됨


==repo 설정==
==repo 설정==
{{참고|MariaDB.repo 설정}}
{{참고|MariaDB.repo 설정}}
<syntaxhighlight lang='console'>
curl -sS https://downloads.mariadb.com/MariaDB/mariadb_repo_setup | sudo bash
</syntaxhighlight>


==설치==
==설치==
<source lang='dos'>
<syntaxhighlight lang='console'>
[root@jmnote ~]# yum install MariaDB-server MariaDB-client
[root@zetawiki ~]# yum install MariaDB-server
... (생략)
... (생략)
===================================================================================================================================
===========================================================================================
  Package                             Arch                      Version                          Repository                   Size
  Package                     Arch         Version                     Repository     Size
===================================================================================================================================
===========================================================================================
Installing:
Installing:
  MariaDB-client                      i386                      5.5.34-1                         mariadb                       12 M
  MariaDB-compat              x86_64      10.1.18-1.el6                mariadb       2.7 M
  MariaDB-server                     i386                      5.5.34-1                         mariadb                       42 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:
Installing for dependencies:
  MariaDB-common                      i386                      5.5.34-1                         mariadb                       29 k
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
Transaction Summary
===================================================================================================================================
===========================================================================================
Install       3 Package(s)
Install     15 Package(s)
Upgrade      0 Package(s)


Total download size: 55 M
Total download size: 168 M
Is this ok [y/N]: y
Is this ok [y/N]: y
</source>
</syntaxhighlight>
<source lang='dos'>
<syntaxhighlight lang='console'>
... (생략)
... (생략)
chown: cannot access `/var/lib/mysql': No such file or directory
PLEASE REMEMBER TO SET A PASSWORD FOR THE MariaDB root USER !
PLEASE REMEMBER TO SET A PASSWORD FOR THE MariaDB root USER !
To do so, start the server, then issue the following commands:
To do so, start the server, then issue the following commands:


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


Alternatively you can run:
Alternatively you can run:
48번째 줄: 65번째 줄:
strongly recommended for production servers.
strongly recommended for production servers.


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


Please report any problems with the '/usr/bin/mysqlbug' script!
Please report any problems at http://mariadb.org/jira


The latest information about MariaDB is available at http://mariadb.org/.
The latest information about MariaDB is available at http://mariadb.org/.
You can find additional information about the MySQL part at:
You can find additional information about the MySQL part at:
http://dev.mysql.com
http://dev.mysql.com
Support MariaDB development by buying support/new features from
Support MariaDB development by buying support/new features from MariaDB
Monty Program Ab. You can contact us about this at sales@montyprogram.com.
Corporation Ab. You can contact us about this at sales@mariadb.com.
Alternatively consider joining our community based development effort:
Alternatively consider joining our community based development effort:
http://kb.askmonty.org/en/contributing-to-the-mariadb-project/
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:
Installed:
   MariaDB-client.i386 0:5.5.34-1                                   MariaDB-server.i386 0:5.5.34-1                                
   MariaDB-compat.x86_64 0:10.1.18-1.el6        MariaDB-server.x86_64 0:10.1.18-1.el6     


Dependency Installed:
Dependency Installed:
   MariaDB-common.i386 0:5.5.34-1                                                                                                  
  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!
Complete!
</source>
</syntaxhighlight>
:→ DB를 실행하고 패스워드를 설정하라는 안내가 나온다.
:→ DB를 실행하고 패스워드를 설정하라는 안내가 나온다.
:→ 그런데 mysql 이라는 이름이 자꾸 보인다. (문제는 없다.)
:→ 그런데 mysql 이라는 이름이 자꾸 보인다. (문제는 없다.)


==확인 2==
==확인 2==
<source lang='dos'>
<syntaxhighlight lang='console'>
[root@jmnote ~]# rpm -qa | grep MariaDB
[root@zetawiki ~]# rpm -qa | grep MariaDB
MariaDB-server-5.5.34-1
MariaDB-common-10.1.18-1.el6.x86_64
MariaDB-common-5.5.34-1
MariaDB-client-10.1.18-1.el6.x86_64
MariaDB-client-5.5.34-1
MariaDB-compat-10.1.18-1.el6.x86_64
</source>
MariaDB-server-10.1.18-1.el6.x86_64
</syntaxhighlight>


==DB 시작 / 패스워드 변경==
==DB 시작 / 패스워드 변경==
아까 나왔던 안내대로 DB를 시작하고 패스워드를 바꾼다.
아까 나왔던 안내대로 DB를 시작하고 패스워드를 바꾼다.
<source lang='dos'>
<syntaxhighlight lang='console'>
[root@jmnote ~]# service mysql start
[root@zetawiki ~]# /etc/init.d/mysql start
Starting MySQL..                                           [  OK  ]
Starting MySQL.161014 20:20:41 mysqld_safe Logging to '/var/lib/mysql/localhost.localdomain.err'.
</source>
. SUCCESS!
<source lang='dos'>
</syntaxhighlight>
[root@jmnote ~]# /usr/bin/mysqladmin -u root password 'P@ssw0rd'
<syntaxhighlight lang='console'>
</source>
[root@zetawiki ~]# /usr/bin/mysqladmin -u root password 'P@ssw0rd'
[root@jmnote ~]# netstat -anp | grep 3306
</syntaxhighlight>
tcp        0      0 :::3306                    :::*                        LISTEN      18379/mysqld
<syntaxhighlight lang='console'>
</source>
[root@zetawiki ~]# netstat -anp | grep 3306
tcp        0      0 :::3306                    :::*                        LISTEN      3268/mysqld
</syntaxhighlight>
:서비스 등록도 mysql이란 이름으로 되어 있고, 포트도 3306, 데몬이름도 mysqld이다.
:서비스 등록도 mysql이란 이름으로 되어 있고, 포트도 3306, 데몬이름도 mysqld이다.


==접속 확인==
==접속 확인==
<source lang='dos'>
<syntaxhighlight lang='console'>
[root@jmnote ~]# mysql -uroot -p
[root@zetawiki ~]# mysql -u root -p
Enter password:  
Enter password:  
</source>
</syntaxhighlight>
<source lang='dos'>
<syntaxhighlight lang='console'>
Welcome to the MariaDB monitor.  Commands end with ; or \g.
Welcome to the MariaDB monitor.  Commands end with ; or \g.
Your MariaDB connection id is 3
Your MariaDB connection id is 4
Server version: 5.5.34-MariaDB MariaDB Server
Server version: 10.1.18-MariaDB MariaDB Server


Copyright (c) 2000, 2013, Oracle, Monty Program Ab and others.
Copyright (c) 2000, 2016, Oracle, MariaDB Corporation Ab and others.


Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
111번째 줄: 163번째 줄:
MariaDB [(none)]> quit
MariaDB [(none)]> quit
Bye
Bye
[root@jmnote ~]#  
[root@zetawiki ~]#  
</source>
</syntaxhighlight>
 
==부팅시 자동시작 설정==
기본으로 설정되어 있지만 한번 더 확인
<syntaxhighlight lang='console'>
[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
</syntaxhighlight>


==같이 보기==
==같이 보기==
*[[MariaDB]]
* [[CentOS7 MariaDB 설치]]
* [[CentOS6 MariaDB 설치:Binary]]
* [[우분투 MariaDB 설치]]
* [[리눅스 MySQL 설치]]
* [[MariaDB]]


==참고 자료==
==참고==
*https://mariadb.com/kb/en/installing-mariadb-with-yum/
*https://mariadb.com/kb/en/installing-mariadb-with-yum/


[[분류: MariaDB]]
[[분류: MariaDB]]

2021년 9월 24일 (금) 23:21 기준 최신판

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

1 확인[ | ]

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

2 repo 설정[ | ]

curl -sS https://downloads.mariadb.com/MariaDB/mariadb_repo_setup | sudo bash

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 -u root -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 }}