Mariadb 소개
http://ko.wikipedia.org/wiki/MariaDB
의존성 패키지 설치
yum -y install cmake make gcc gcc-c++ ncurses-devel libevent openssl openssl-devel libxml2 libxml2-devel bison wget
Mariadb User & Group 생성
/usr/sbin/useradd -r -M -s /sbin/nologin mysql
Mariadb Download
설치준비
tar xvzf mariadb-10.1.9.tar.gz
cd mariadb-10.1.9
mkdir build_target
cd build_target
컴파일
cmake .. \
-DCMAKE_INSTALL_PREFIX=/usr/local/mariadb \
-DWITH_INNOBASE_STORAGE_ENGINE=1 \
-DWITH_ARCHIVE_STORAGE_ENGINE=1 \
-DWITH_BLACKHOLE_STORAGE_ENGINE=1 \
-DMYSQL_DATADIR=/usr/local/mariadb/data \
-DWITH_PERFSCHEMA_STORAGE_ENGINE=1 \
-DWITH_PARTITION_STORAGE_ENGINE=1 \
-DWITH_FEDERATEDX_STORAGE_ENGINE=1 \
-DWITH_ARIA_STORAGE_ENGINE=1 \
-DWITH_XTRADB_STORAGE_ENGINE=1 \
-DDEFAULT_CHARSET=utf8 \
-DDEFAULT_COLLATION=utf8_general_ci \
-DENABLED_LOCAL_INFILE=1 \
-DWITH_EXTRA_CHARSETS=all \
-DWITH_READLINE=1 \
-DWITH_SSL=bundled \
-DWITH_ZLIB=system
make && make install
디렉토리 생성 및 퍼미션 변경
mkdir -p /usr/local/mariadb/InnoDB/redoLogs
mkdir -p /usr/local/mariadb/InnoDB/undoLogs
chown -R mysql /usr/local/mariadb/data
chgrp -R mysql /usr/local/mariadb
mkdir /usr/local/mariadb/logs /usr/local/mariadb/tmp
chown mysql.mysql /usr/local/mariadb/logs
chown mysql.mysql /usr/local/mariadb/tmp
설정파일 복사
cp /usr/local/mariadb/support-files/my-innodb-heavy-4G.cnf /etc/my.cnf
시스템 테이블 생성
cd /usr/local/mariadb
/usr/local/mariadb/scripts/mysql_install_db --datadir=/usr/local/mariadb/data
chown -R mysql.mysql /usr/local/mariadb/data
시스템 시작시 Mariadb 자동시작
cp /usr/local/mariadb/support-files/mysql.server /etc/rc.d/init.d/mariadb
chmod o+x /etc/rc.d/init.d/mariadb
chkconfig --add mariadb
chkconfig --list | grep mariadb
라이브러리 추가
rm -f /etc/ld.so.conf.d/mysql-x86_64.conf
echo "/usr/local/mariadb/lib" > /etc/ld.so.conf.d/mysql.conf
ln -s /usr/local/mariadb/lib /usr/local/mariadb/lib64
Mariadb 시작
service mariadb start
Mariadb root 패스워드 설정
다음 명령어 실행 하여 진행
/usr/local/mairadb/bin/mysql_secure_installation