본문 바로가기

DEV

MariaDB - Linux CentOS 6 에서 MariaDB yum으로 Install

MariaDB - Linux CentOS 6 에서 MariaDB yum으로 설치

 

* CentOS 7에서는 기본 DB가 MySQL에서 MariaDB로 변경

* 아래 내용을 참고하면 CentOS 7에서도 yum으로 설치 가능

 

* OS 정보 확인

> cat /etc/*release*

CentOS release 6.8 (Final)

 

* Bit 확인

> getconf LONG_BIT

64

 

* 기존에 설치된 mysql을 확인 및 삭제 (사용안할것이므로 삭제해서 정리하는 편이 낫다고 봄)

rpm -qa | grep mysql

 

yum remove mysql

 

 

* yum으로 maria DB 설치guide는 아래 URL 참조

https://mariadb.com/kb/en/mariadb/yum/

 

* OS 정보 확인후 yum repository 확인

아래 URL에서 OS 및 설치 버젼 선택하여 MariaDB Repositories 셋팅 정보를 확인.

https://downloads.mariadb.org/mariadb/repositories

 

위 정보대로 CentOS6 x86_64 / MariaDB 10.1 (Stable) 버젼 설치할 것임. 아래에서 나온 Repositories 정보로 yum 설치 진행

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

 

 

# MariaDB 10.1 CentOS repository list - created 2017-03-27 07:22 UTC # http://downloads.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

[표1]

 

 

* MariaDB repository 생성

vi /etc/yum.repos.d/MariaDB.repo

위 [표1]내용 붙여넣기 한후 저장

 

- 내용 확인

cat /etc/yum.repos.d/MariaDB.repo

 

* MariaDB 설치전 update 진행

yum -y update

 

* yum으로 MariaDB 설치

yum install MariaDB-server MariaDB-client

 

 

* 설치 확인

rpm -qa | grep MariaDB

MariaDB-shared-10.1.22-1.el6.x86_64

MariaDB-client-10.1.22-1.el6.x86_64

MariaDB-common-10.1.22-1.el6.x86_64

MariaDB-compat-10.1.22-1.el6.x86_64

MariaDB-server-10.1.22-1.el6.x86_64

 

* MariaDB 실행

/etc/init.d/mysql start

 

 

* MariaDB root 패스워드 변경

/usr/bin/mysqladmin -u root password "패스워드"

 

* 리스너 확인

netstat -anp | grep 3306

 

> netstat -anp | grep 3306

tcp        0      0 :::3306                     :::*                        LISTEN      35348/mysqld 

 

 

* MariaDB 접속 확인

mysql -uroot -p

 

> mysql -uroot -p

Enter password: 

Welcome to the MariaDB monitor.  Commands end with ; or \g.

Your MariaDB connection id is 5

Server version: 10.1.22-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

 

 

* MariaDB 재시작

service mysql stop

 

service mysql start

 

 

※ 참고

https://mariadb.org/

https://mariadb.com/