CentOS 7 Source code compilation MARIADB

Source: Internet
Author: User

Download the source Package

installing devtoolset-7

MariaDB compile the TOKUDB engine will use the C++11 standard, the system is the highest version of the GCC 4.8.5 support c++11 Standard, but even if the designation -DCMAKE_CXX_FLAGS=-std=c++11 is not. Manually compiling a later version of GCC is too cumbersome, devtoolset-7 is installed directly here, of course, you can disable the TOKUDB engine is understandable

[Email protected] ~]#Yum-YInstallCENTOS-RELEASE-SCL devtoolset-7[[Email protected]~]#GCC--versionGCC(GCC)4.8.5 20150623(Red Hat4.8.5- -) Copyright?  -Free Software Foundation, Inc. this procedure is freeware; Please refer to the copyright notice of the source code. The software does not have any warranties, including warranties of merchantability and fitness for a particular purpose. [[Email protected]~]# SCL Enable devtoolset-7Bash[[email protected]~]#GCC--versionGCC(GCC)7.3.1 20180303(Red Hat7.3.1-5) Copyright (C) .Free software Foundation, Inc.this is FreeSoftware; See the source forcopying conditions. There is nowarranty; Not even formerchantability or FITNESS for A particular PURPOSE.

Install dependent packages

# Install dependent packages [[email protected]~]#Yum Install-Y Gnutls-develGCC GCC-c++ cmake ncurses-devel bison-devel bison libaio-devel libevent libxml2-devel# creating MySQL users and groups [[email protected]~]# useradd-m-s/sbin/nologin mysql# CREATE DATABASE data storage directory [[email protected]~]#mkdir/mydata/mariadb/-P[[email protected]~]#Chown-R Mysql.mysql/mydata# Unzip, compile, install Mariadb[[email protected]~]#TarXfTarmariadb-10.3.7.Tar. gz-c/usr/src/[[Email protected]~]# cd/usr/src/mmariadb-10.3.7/[email protected] mariadb-10.3.7]# CMake. -dcmake_install_prefix=/usr/local/MySQL-dmysql_unix_addr=/tmp/Mysql.sock-dmysql_datadir=/mydata/mariadb-dsysconfdir=/etc-dmysql_user=MySQL-dmysql_tcp_port=3306       -dwith_xtradb_storage_engine=1       -dwith_innobase_storage_engine=1       -dwith_partition_storage_engine=1       -dwith_blackhole_storage_engine=1       -dwith_myisam_storage_engine=1       -dwith_readline=1       -denabled_local_infile=1       -dwith_extra_charsets= All-ddefault_charset=UTF8-ddefault_collation=Utf8_general_ci-dextra_charsets= All-dwith_big_tables=1       -dwith_debug=0  && Make-j4 && Make-j4Install

Initializing the installation database

[Email protected] mariadb-10.3. 7] # cd/usr/local/mysql/[[email protected] mysql]#. /scripts/mysql_install_db--user=mysql--basedir=/usr/local/mysql/  --datadir=/mydata/mariadb/CP /usr/local/mysql/support-files/mysql.server/etc/init.d/chmod +x/etc/init.d/-- Add mariadb
[Email protected] mysql]# ln-s/usr/local/mysql/bin*/usr/local/bin

Configuring the MARIADB configuration file

[[email protected] mysql]# vim/etc/my.cnf# Only modify these two datadir=/mydata/mariadbsocket=/tmp/mysql.sock

Start the MARIADB database service

[[email protected] mysql]# systemctl start  

after the configuration is complete, you can use MARIADB with mysql command.

CentOS 7 Source code compilation MARIADB

Related Article

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.