Server

MariaDB 설치 (CentOS6.7 + MariaDB 10.1)

Author: Thorpe Lee(koangbok@gmail.com), Front&Back-end Developer, posted on 2016-07-30 10:41:39

Print - 프린트하기


DESCRIPTION

1.Notice

Steps : Install MariaDB ( Base on CentOS )

2.Application and Envirment

OS CentOS 6.5 64bit
MariaDb 10.1

 

3.Common


root@shell:~$ yum update
root@shell:~$ yum install git rdate zip unzip wget

INSTALL

1. 설치 관련 문서


https://downloads.mariadb.org/mariadb/repositories/#mirror=kaist&distro=CentOS&distro_release=centos6-amd64--centos6&version=10.1
https://mariadb.com/kb/en/mariadb/yum/

위 싸이트를 방문하면 서버의 환경에 맞게 원하는 설치문서를 보실수 있습니다. 전 CentOS 에 MariaDB 10.1를 설치하기위하여 아래와 같이 선턱했습니다.

root@shell:~$ vi /etc/yum.repos.d/MariaDB.repo

# MariaDB 10.1 CentOS repository list - created 2016-03-22 07:54 UTC
# http://mariadb.org/mariadb/repositories/
[mariadb]
name = MariaDB
baseurl = http://yum.mariadb.org/10.1/centos6-amd64
gpgkey=https://yum.mariadb.org/RPM-GPG-KEY-MariaDB
gpgcheck=1

root@shell:~$ yum install MariaDB-server MariaDB-client

Loaded plugins: fastestmirror
Setting up Install Process
Loading mirror speeds from cached hostfile
 * base: ftp.daumkakao.com
 * epel: mirror.premi.st
 * extras: ftp.daumkakao.com
 * updates: ftp.daumkakao.com
 * webtatic: sp.repo.webtatic.com
mariadb                                                                                                      | 2.9 kB     00:00     
mariadb/primary_db                                                                                           |  19 kB     00:00     
Resolving Dependencies
--> Running transaction check
---> Package MariaDB-client.x86_64 0:10.1.16-1.el6 will be installed
--> Processing Dependency: libaio.so.1(LIBAIO_0.4)(64bit) for package: MariaDB-client-10.1.16-1.el6.x86_64
--> Processing Dependency: MariaDB-common for package: MariaDB-client-10.1.16-1.el6.x86_64
--> Processing Dependency: libaio.so.1(LIBAIO_0.1)(64bit) for package: MariaDB-client-10.1.16-1.el6.x86_64
--> Processing Dependency: libaio.so.1()(64bit) for package: MariaDB-client-10.1.16-1.el6.x86_64
---> Package MariaDB-server.x86_64 0:10.1.16-1.el6 will be installed
--> Processing Dependency: lsof for package: MariaDB-server-10.1.16-1.el6.x86_64
--> Processing Dependency: galera for package: MariaDB-server-10.1.16-1.el6.x86_64
--> Processing Dependency: perl(DBI) for package: MariaDB-server-10.1.16-1.el6.x86_64
--> Processing Dependency: libjemalloc.so.1()(64bit) for package: MariaDB-server-10.1.16-1.el6.x86_64
--> Running transaction check
---> Package MariaDB-common.x86_64 0:10.1.16-1.el6 will be installed
--> Processing Dependency: MariaDB-compat for package: MariaDB-common-10.1.16-1.el6.x86_64
---> Package galera.x86_64 0:25.3.15-1.rhel6.el6 will be installed
---> Package jemalloc.x86_64 0:3.6.0-1.el6 will be installed
---> Package libaio.x86_64 0:0.3.107-10.el6 will be installed
---> Package lsof.x86_64 0:4.82-5.el6 will be installed
---> Package perl-DBI.x86_64 0:1.609-4.el6 will be installed
--> Running transaction check
---> Package MariaDB-compat.x86_64 0:10.1.16-1.el6 will be obsoleting
---> Package mysql-libs.x86_64 0:5.1.73-7.el6 will be obsoleted
--> Finished Dependency Resolution

Dependencies Resolved

====================================================================================================================================
 Package                          Arch                     Version                                  Repository                 Size
====================================================================================================================================
Installing:
 MariaDB-client                   x86_64                   10.1.16-1.el6                            mariadb                    40 M
 MariaDB-compat                   x86_64                   10.1.16-1.el6                            mariadb                   2.7 M
     replacing  mysql-libs.x86_64 5.1.73-7.el6
 MariaDB-server                   x86_64                   10.1.16-1.el6                            mariadb                   104 M
Installing for dependencies:
 MariaDB-common                   x86_64                   10.1.16-1.el6                            mariadb                    42 k
 galera                           x86_64                   25.3.15-1.rhel6.el6                      mariadb                   8.5 M
 jemalloc                         x86_64                   3.6.0-1.el6                              epel                      100 k
 libaio                           x86_64                   0.3.107-10.el6                           base                       21 k
 lsof                             x86_64                   4.82-5.el6                               base                      324 k
 perl-DBI                         x86_64                   1.609-4.el6                              base                      705 k

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

Total download size: 157 M
Is this ok [y/N]: y
Downloading Packages:
(1/9): MariaDB-10.1.16-centos6-x86_64-client.rpm                                                             |  40 MB     00:11     
(2/9): MariaDB-10.1.16-centos6-x86_64-common.rpm                                                             |  42 kB     00:00     
(3/9): MariaDB-10.1.16-centos6-x86_64-compat.rpm                                                             | 2.7 MB     00:03     
(4/9): MariaDB-10.1.16-centos6-x86_64-server.rpm                                                             | 104 MB     00:26     
(5/9): galera-25.3.15-1.rhel6.el6.x86_64.rpm                                                                 | 8.5 MB     00:01     
(6/9): jemalloc-3.6.0-1.el6.x86_64.rpm                                                                       | 100 kB     00:00     
(7/9): libaio-0.3.107-10.el6.x86_64.rpm                                                                      |  21 kB     00:00     
(8/9): lsof-4.82-5.el6.x86_64.rpm                                                                            | 324 kB     00:00     
(9/9): perl-DBI-1.609-4.el6.x86_64.rpm                                                                       | 705 kB     00:00     
------------------------------------------------------------------------------------------------------------------------------------
Total                                                                                               3.4 MB/s | 157 MB     00:45     
경고: rpmts_HdrFromFdno: Header V4 DSA/SHA1 Signature, key ID 1bb943db: NOKEY
Retrieving key from https://yum.mariadb.org/RPM-GPG-KEY-MariaDB
Importing GPG key 0x1BB943DB:
 Userid: "MariaDB Package Signing Key "
 From  : https://yum.mariadb.org/RPM-GPG-KEY-MariaDB
Is this ok [y/N]: y
Running rpm_check_debug
Running Transaction Test
Transaction Test Succeeded
Running Transaction
  Installing : libaio-0.3.107-10.el6.x86_64                                                                                    1/10 
  Installing : MariaDB-common-10.1.16-1.el6.x86_64                                                                             2/10 
  Installing : MariaDB-compat-10.1.16-1.el6.x86_64                                                                             3/10 
  Installing : MariaDB-client-10.1.16-1.el6.x86_64                                                                             4/10 
  Installing : jemalloc-3.6.0-1.el6.x86_64                                                                                     5/10 
  Installing : perl-DBI-1.609-4.el6.x86_64                                                                                     6/10 
  Installing : galera-25.3.15-1.rhel6.el6.x86_64                                                                               7/10 
  Installing : lsof-4.82-5.el6.x86_64                                                                                          8/10 
  Installing : MariaDB-server-10.1.16-1.el6.x86_64                                                                             9/10 
chown: cannot access `/var/lib/mysql': 그런 파일이나 디렉터리가 없습니다
2016-08-08 10:00:48 139936870860832 [Note] /usr/sbin/mysqld (mysqld 10.1.16-MariaDB) starting as process 1825 ...
2016-08-08 10:00:48 139936870860832 [Note] InnoDB: Using mutexes to ref count buffer pool pages
2016-08-08 10:00:48 139936870860832 [Note] InnoDB: The InnoDB memory heap is disabled
2016-08-08 10:00:48 139936870860832 [Note] InnoDB: Mutexes and rw_locks use GCC atomic builtins
2016-08-08 10:00:48 139936870860832 [Note] InnoDB: Memory barrier is not used
2016-08-08 10:00:48 139936870860832 [Note] InnoDB: Compressed tables use zlib 1.2.3
2016-08-08 10:00:48 139936870860832 [Note] InnoDB: Using Linux native AIO
2016-08-08 10:00:48 139936870860832 [Note] InnoDB: Using SSE crc32 instructions
2016-08-08 10:00:48 139936870860832 [Note] InnoDB: Initializing buffer pool, size = 128.0M
2016-08-08 10:00:48 139936870860832 [Note] InnoDB: Completed initialization of buffer pool
2016-08-08 10:00:48 139936870860832 [Note] InnoDB: The first specified data file ./ibdata1 did not exist: a new database to be created!
2016-08-08 10:00:48 139936870860832 [Note] InnoDB: Setting file ./ibdata1 size to 12 MB
2016-08-08 10:00:48 139936870860832 [Note] InnoDB: Database physically writes the file full: wait...
2016-08-08 10:00:48 139936870860832 [Note] InnoDB: Setting log file ./ib_logfile101 size to 48 MB
2016-08-08 10:00:49 139936870860832 [Note] InnoDB: Setting log file ./ib_logfile1 size to 48 MB
2016-08-08 10:00:51 139936870860832 [Note] InnoDB: Renaming log file ./ib_logfile101 to ./ib_logfile0
2016-08-08 10:00:51 139936870860832 [Warning] InnoDB: New log files created, LSN=45883
2016-08-08 10:00:51 139936870860832 [Note] InnoDB: Doublewrite buffer not found: creating new
2016-08-08 10:00:52 139936870860832 [Note] InnoDB: Doublewrite buffer created
2016-08-08 10:00:52 139936870860832 [Note] InnoDB: 128 rollback segment(s) are active.
2016-08-08 10:00:52 139936870860832 [Warning] InnoDB: Creating foreign key constraint system tables.
2016-08-08 10:00:52 139936870860832 [Note] InnoDB: Foreign key constraint system tables created
2016-08-08 10:00:52 139936870860832 [Note] InnoDB: Creating tablespace and datafile system tables.
2016-08-08 10:00:52 139936870860832 [Note] InnoDB: Tablespace and datafile system tables created.
2016-08-08 10:00:52 139936870860832 [Note] InnoDB: Waiting for purge to start
2016-08-08 10:00:52 139936870860832 [Note] InnoDB:  Percona XtraDB (http://www.percona.com) 5.6.30-76.3 started; log sequence number 0
2016-08-08 10:00:52 139936103659264 [Note] InnoDB: Dumping buffer pool(s) not yet started
2016-08-08 10:00:55 140079406684192 [Note] /usr/sbin/mysqld (mysqld 10.1.16-MariaDB) starting as process 1854 ...
2016-08-08 10:00:55 140079406684192 [Note] InnoDB: Using mutexes to ref count buffer pool pages
2016-08-08 10:00:55 140079406684192 [Note] InnoDB: The InnoDB memory heap is disabled
2016-08-08 10:00:55 140079406684192 [Note] InnoDB: Mutexes and rw_locks use GCC atomic builtins
2016-08-08 10:00:55 140079406684192 [Note] InnoDB: Memory barrier is not used
2016-08-08 10:00:55 140079406684192 [Note] InnoDB: Compressed tables use zlib 1.2.3
2016-08-08 10:00:55 140079406684192 [Note] InnoDB: Using Linux native AIO
2016-08-08 10:00:55 140079406684192 [Note] InnoDB: Using SSE crc32 instructions
2016-08-08 10:00:55 140079406684192 [Note] InnoDB: Initializing buffer pool, size = 128.0M
2016-08-08 10:00:55 140079406684192 [Note] InnoDB: Completed initialization of buffer pool
2016-08-08 10:00:55 140079406684192 [Note] InnoDB: Highest supported file format is Barracuda.
2016-08-08 10:00:55 140079406684192 [Note] InnoDB: 128 rollback segment(s) are active.
2016-08-08 10:00:55 140079406684192 [Note] InnoDB: Waiting for purge to start
2016-08-08 10:00:55 140079406684192 [Note] InnoDB:  Percona XtraDB (http://www.percona.com) 5.6.30-76.3 started; log sequence number 1616799
2016-08-08 10:00:55 140078653339392 [Note] InnoDB: Dumping buffer pool(s) not yet started
2016-08-08 10:00:58 140585609570336 [Note] /usr/sbin/mysqld (mysqld 10.1.16-MariaDB) starting as process 1884 ...
2016-08-08 10:00:58 140585609570336 [Note] InnoDB: Using mutexes to ref count buffer pool pages
2016-08-08 10:00:58 140585609570336 [Note] InnoDB: The InnoDB memory heap is disabled
2016-08-08 10:00:58 140585609570336 [Note] InnoDB: Mutexes and rw_locks use GCC atomic builtins
2016-08-08 10:00:58 140585609570336 [Note] InnoDB: Memory barrier is not used
2016-08-08 10:00:58 140585609570336 [Note] InnoDB: Compressed tables use zlib 1.2.3
2016-08-08 10:00:58 140585609570336 [Note] InnoDB: Using Linux native AIO
2016-08-08 10:00:58 140585609570336 [Note] InnoDB: Using SSE crc32 instructions
2016-08-08 10:00:58 140585609570336 [Note] InnoDB: Initializing buffer pool, size = 128.0M
2016-08-08 10:00:58 140585609570336 [Note] InnoDB: Completed initialization of buffer pool
2016-08-08 10:00:58 140585609570336 [Note] InnoDB: Highest supported file format is Barracuda.
2016-08-08 10:00:58 140585609570336 [Note] InnoDB: 128 rollback segment(s) are active.
2016-08-08 10:00:58 140585609570336 [Note] InnoDB: Waiting for purge to start
2016-08-08 10:00:58 140585609570336 [Note] InnoDB:  Percona XtraDB (http://www.percona.com) 5.6.30-76.3 started; log sequence number 1616809
2016-08-08 10:00:58 140584855500544 [Note] InnoDB: Dumping buffer pool(s) not yet started

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 amicogenCRM 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                                                                                 10/10 
  Verifying  : MariaDB-client-10.1.16-1.el6.x86_64                                                                             1/10 
  Verifying  : lsof-4.82-5.el6.x86_64                                                                                          2/10 
  Verifying  : MariaDB-compat-10.1.16-1.el6.x86_64                                                                             3/10 
  Verifying  : galera-25.3.15-1.rhel6.el6.x86_64                                                                               4/10 
  Verifying  : perl-DBI-1.609-4.el6.x86_64                                                                                     5/10 
  Verifying  : jemalloc-3.6.0-1.el6.x86_64                                                                                     6/10 
  Verifying  : MariaDB-common-10.1.16-1.el6.x86_64                                                                             7/10 
  Verifying  : MariaDB-server-10.1.16-1.el6.x86_64                                                                             8/10 
  Verifying  : libaio-0.3.107-10.el6.x86_64                                                                                    9/10 
  Verifying  : mysql-libs-5.1.73-7.el6.x86_64                                                                                 10/10 

Installed:
  MariaDB-client.x86_64 0:10.1.16-1.el6      MariaDB-compat.x86_64 0:10.1.16-1.el6      MariaDB-server.x86_64 0:10.1.16-1.el6     

Dependency Installed:
  MariaDB-common.x86_64 0:10.1.16-1.el6          galera.x86_64 0:25.3.15-1.rhel6.el6          jemalloc.x86_64 0:3.6.0-1.el6         
  libaio.x86_64 0:0.3.107-10.el6                 lsof.x86_64 0:4.82-5.el6                     perl-DBI.x86_64 0:1.609-4.el6         

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

Complete!


root@shell:~$ chkconfig mysql on

 

이제 Mysql 데몬을 실행합니다.

root@shell:~$ /etc/init.d/mysql start

Starting MySQL. SUCCESS! 

 

위와 같이 데몬이 정상적으로 실행하였다면 이제 Mysql 서버에 접속해봅니다.

root@shell:~$ mysql -u root -p mysql

Enter password:   <- 비밀번호를 아무것도 지정안하였기때문에 그냥 엔터를 눌러주세요.
Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -A

Welcome to the MariaDB monitor.  Commands end with ; or \g.
Your MariaDB connection id is 3
Server version: 10.1.16-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 [mysql]> 

위의 화면을 보았다면 MariaDB  설치가 완료되었습니다.