본문 바로가기

리눅스

[리눅스] mariadb 소스 컴파일

728x90

mariadb 소스 컴파일

필수 라이브러리

yum install -y ncurses-devel cmake libevent

 

tar xvfz mariadb-10.0.20.tar.gz
cd mariadb-10.0.20

 

groupadd -g 27 mysql
useradd -m -c "MariaDB Server" -d /app/mariadb -s /bin/false -u 27 -g 27 mysql

 

cmake \
-DCMAKE_INSTALL_PREFIX=/app/mariadb \
-DMYSQL_DATADIR=/app/mariadb/data \
-DWITH_INNOBASE_STORAGE_ENGINE=1 \
-DWITH_ARCHIVE_STORAGE_ENGINE=1 \
-DWITH_BLACKHOLE_STORAGE_ENGINE=1 \
-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=system \
-DWITH_ZLIB=system

 

make && make install

 

$ pwd
/app/mariadb/support-files
cp my-innodb-heavy-4G.cnf /etc/my.cnf
cp mysql.server /etc/init.d/mysqld

mysql 데몬 실행 및 권한 부여

chmod 755 /etc/init.d/mysqld
chown -R mysql:mysql /etc/init.d/mysqld

DB 생성

/app/mariadb/scripts/mysql_install_db -user=mysql -basedir=/app/mariadb -datadir=/app/mariadb/data
728x90