CentOS MariaDB 소스 설치하기

MariaDB 설치

 

Cmake설치

./bootstrap

make

make install


 

1.설치에 필요한 패키지 설치

 

yum -y remove mysql-libs

yum -y install cmake make gcc gcc-c++ ncurses-devel libevent openssl openssl-devel libxml2 libxml2-devel bison wget

 


2.Mariadb Group & User 생성

 

groupadd -g 27 -o -r mysql

useradd -M -g mysql -o -r -d /usr/local/mariadb/data -s /bin/false -c “MariaDB” -u 27 mysql



3.Mariadb download

 

Mariadb 사이트에서 다운받는다.

https://downloads.mariadb.org/

 

 

5.Compile

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



6.디렉토리 생성 및 퍼미션 변경

chown -R mysql /usr/local/mariadb/data

chgrp -R mysql /usr/local/mariadb



7.my.cnf 복사

cp /usr/local/mariadb/support_files/my-medium.cnf /etc/my.cnf



8.시스템 테이블 생성

/usr/local/mariadb/scripts/mysql_install_db —basedir =/usr/local/mariadb --datadir=/usr/local/mariadb/data

chown -R mysql.mysql /usr/local/mariadb/data

 


9.시스템 시작시 Mariadb 자동시작

cp /usr/local/mariadb/support-files/mysql.server /etc/rc.d/init.d/mysqld

chmod 755 /etc/rc.d/init.d/mysqld

chkconfig --add mysqld

chkconfig --list | grep mysqld

 

10.Mariadb startup

service mysqld start


 댓글

댓글 목록 (0개)