|
|
1. https://downloads.mariadb.org/ 에서 stable을 최신버전 다운로드.
2. tar zxvf mariadb.tar.gz 압축해제
3. 컴파일 작업
[root@hahaha ~]# cmake \
-DWITH_READLINE=1 \
-DWITH_SSL=bundled \
-DWITH_ZLIB=system \
-DDEFAULT_CHARSET=utf8 \
-DDEFAULT_COLLATION=utf8_general_ci \
-DENABLED_LOCAL_INFILE=1 \
-DWITH_EXTRA_CHARSETS=all \
-DWITH_ARIA_STORAGE_ENGINE=1 \
-DWITH_XTRADB_STORAGE_ENGINE=1 \
-DWITH_ARCHIVE_STORAGE_ENGINE=1 \
-DWITH_INNOBASE_STORAGE_ENGINE=1 \
-DWITH_PARTITION_STORAGE_ENGINE=1 \
-DWITH_BLACKHOLE_STORAGE_ENGINE=1 \
-DWITH_FEDERATEDX_STORAGE_ENGINE=1 \
-DWITH_PERFSCHEMA_STORAGE_ENGINE=1 \
-DCMAKE_INSTALL_PREFIX=/usr/local/mariadb \
-DMYSQL_DATADIR=/usr/local/mariadb/data
4. make ; make install
5. user and group
[root@hahaha ~]# groupadd -g 27 -o -r mysql
[root@hahaha ~]# useradd -M -g mysql -o -r -d /usr/local/mariadb/data -s /bin/false -c "MariaDB" -u 27 mysql
6.mkdir -p /usr/local/mariadb/InnoDB/{redoLogs,undoLogs,ib_data}
7. mkdir /usr/local/mariadb/logs /usr/local/mariadb/tmp
8. /usr/local/mariadb/scripts/mysql_install_db --basedir=/usr/local/mariadb --datadir=/usr/local/mariadb/data
9. chown -R mysql:mysql /usr/local/mariadb
10. ./support-files/mysql.server /etc/init.d/mysqld
11. chkconfig --add mysqld
12. echo "/usr/local/mariadb/lib" > /etc/ld.so.conf.d/mysql.conf
또는
echo "/usr/local/mariadb/lib" > /etc/ld.so.conf
13. 64bit의 경우 심볼릭 링크
cd /usr/local/mariadb
ln -s lib lib64
14. ldconfig
15. cp /usr/local/mariadb/support-files/my-huge.cnf /etc/my.cnf
16. service mysqld start
17. mysqladmin -u root password 'new-password'