MariaDB compilation and installation, mariadb Compilation

Source: Internet
Author: User
Tags install openssl

MariaDB compilation and installation, mariadb Compilation
1. Create a user

useradd -r -s /sbin/nologin mysql

2. Download and decompress the Software Package
wget http://mirrors.neusoft.edu.cn/mariadb//mariadb-10.2.12/source/mariadb-10.2.12.tar.gz
tar xvf mariadb-10.2.12.tar.gz

3. Package groups required for Installation
yum groupinstall "development tools"
yum install cmake
yum install ncurses-devel
yum install gnutls-devel
yum install libevent-devel
yum install libaio-devel
yum install openssl-devel
yum install libxml2-devel
4. Create a database directory and set the owner Group
mkdir /mysqldbchown -R mysql.mysql /mysqldb

V. Compilation and Installation
cd mariadb-10.2.12/

Cmake .\
-DCMAKE_INSTALL_PREFIX =/app/mysql \
-DMYSQL_DATADIR =/mysqldb /\
-DSYSCONFDIR =/etc \
-DMYSQL_USER = mysql \
-DWITH_INNOBASE_STORAGE_ENGINE = 1 \
-DWITH_ARCHIVE_STORAGE_ENGINE = 1 \
-DWITH_BLACKHOLE_STORAGE_ENGINE = 1 \
-DWITH_READLINE = 1 \
-DWITH_SSL = system \
-DWITH_ZLIB = system \
-DWITH_LIBWRAP = 0 \
-DMYSQL_UNIX_ADDR =/app/mysql. sock \
-DDEFAULT_CHARSET = utf8 \
-DDEFAULT_COLLATION = utf8_general_ci \
-DENABLED_LOCAL_INFILE = 1 \
-DWITH_PARTITION_STORAGE_ENGINE = 1 \
-DWITH_DEBUG = 0 \
-DWITHOUT_MROONGA_STORAGE_ENGINE = 1

 

make && make install

 

Vi. Environment Variables
echo 'PATH=/app/mysql/bin/:$PATH' > /etc/profile.d/mysql.sh. /etc/profile.d/mysql.shchmod +x /etc/profile.d/mysql.sh

VII. Generate a database
/app/mysql/scripts/mysql_install_db --basedir=/app/mysql --datadir=/mysqldb --user=mysql

8. Program Directory Permissions
chgrp -R mysql /app/mysql/chmod 775 /app/mysql/

IX. Configuration File
cp /app/mysql/support-files/my-huge.cnf /etc/my.cnf
vim /etc/my.cnf

10. Startup Script
cp /app/mysql/support-files/mysql.server /etc/init.d/mysqld
chkconfig --add mysqld

11. Start the service
service mysqld start

12. test connection

 

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.