MARIADB Source and binary installation

Source: Internet
Author: User

General-purpose binary format installation process preparation
    • Download mariadb-10.2.15-linux-x86_64.tar.gz
    • Check environment Iptables SELinux
    • Database Storage Directory/data/mysqldb
Create user

Useradd-r-d/data/mysqldb-s/sbin/nologin MySQL

Create the installation path (MARIADB program installation path)

Look at the official documentation, confirm the path to the compilation/usr/local/mysql

Tar xvf mariadb-10.2.15-linux-x86_64.tar.gz-c/usr/local/

Ln-s mariadb-10.2.15-linux-x86_64 MySQL

Chown-r Root:root mysql/

echo Path=/usr/local/mysql/bin: $PATH >/etc/profile.d/mysql.sh

Create a database storage location

Mkdir-pv/data/mysqldb

Chown Mysql.mysql/data/mysqldb
chmod 770/data/mysqldb

Build Database

Cd/usr/local/mysql

scripts/mysql_install_db--datadir=/data/mysqldb--user=mysql

Change the configuration file

Cd/usr/local/mysql

CP SUPPORT-FILES/MY-HUGE.CNF/ETC/MY.CNF

Vim/etc/my.cnf

[MYSQLD] Server configuration

DataDir =/data/mysqldb

Start the database

Cd/usr/local/mysql
CP Support-files/mysql.server/etc/init.d/mysqld

Chkconfig--add mysqld

Service mysqld Start

/usr/local/mysql/bin/mysqld--print-defaults (check default configuration)

Mysql_secure_installation (set security Policy)

Mysql-uroot-pverimatrix (Login database)

Source code compilation install MARIADB installation package

Yum Install Bison bison-devel zlib-devel libcurl-devel libarchive-devel boost-devel gcc gcc-c++ cmake libevent-devel gnutl S-devel libaio-devel openssl-devel ncurses-devel libxml2-devel

Create user

Useradd-r-s/sbin/nologin MySQL

Unzip the source file

Tar xvf mariadb-10.2.15.tar.gz

Mkdir-pv/data/mysqldb

Chown Mysql.mysql/data/mysqldb

CMake compiled installation (mariadb binary in/app/mysql directory, database in/DATA/MYSQLDB)

CD mariadb-10.2.12/

CMake. \
-dcmake_install_prefix=/app/mysql \
-dmysql_datadir=/data/mysqldb/\
-DSYSCONFDIR=/ETC \
-dmysql_user=mysql \
-dwith_innobase_storage_engine=1 \
-dwith_archive_storage_engine=1 \
-dwith_blackhole_storage_engine=1 \
-dwith_partition_storage_engine=1 \
-dwithout_mroonga_storage_engine=1 \
-dwith_debug=0 \
-dwith_readline=1 \
-dwith_ssl=system \
-dwith_zlib=system \
-dwith_libwrap=0 \
-denabled_local_infile=1 \
-dmysql_unix_addr=/tmp/mysql.sock \
-ddefault_charset=utf8 \
-ddefault_collation=utf8_general_ci
Make-j 2 && make install

Configuration database

Echo ' Path=/app/mysql/bin: $PATH ' >/etc/profile.d/mysql.sh

. /etc/profile.d/mysql.sh

cd/app/mysql/
scripts/mysql_install_db--datadir=/data/mysqldb/--user=mysql

Cp/app/mysql/support-files/my-huge.cnf/etc/my.cnf

MARIADB Source and binary installation

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.