MySQL 5.7.19 Source Installation

Source: Internet
Author: User

MySQL 5.7.19 Source Installation

1. Installing dependent Packages
# yum-y Install ncurses-devel libaio-devel cmake gcc gcc-c++ bison perl-time-hires

2. Download and install boost
2.1. Download the Package
# wget http://nchc.dl.sourceforge.net/project/boost/boost/1.59.0/boost_1_59_0.tar.gz

2.2. Unzip
# Tar XF boost_1_59_0.tar.gz

2.3. Put the boost package under/usr/local/boost
# MV Boost_1_59_0/usr/local/boost

3. Create a MySQL account
# useradd-s/sbin/nologin-m MySQL

Verify
# ID MySQL

  

4. Download, unzip MySQL
# Mkdir/root/tools
# Cd/root/tools
# wget https://dev.mysql.com/get/Downloads/MySQL-5.7/mysql-5.7.19.tar.gz
# Tar XF mysql-5.7.19.tar.gz

5. Install MySQL
5.1. CMake Decompression and Setup MSYQL

CMake. -dcmake_install_prefix=/application/mysql-5.7.19-dmysql_datadir=/application/mysql-5.7.19/data-dmysql_unix_ Addr=/application/mysql-5.7.19/tmp/mysql.sock-ddefault_charset=utf8-ddefault_collation=utf8_general_ci-dwith_ Extra_charsets=all-dwith_innobase_storage_engine=1-dwith_federated_storage_engine=1-dwith_blackhole_storage_ Engine=1-dwithout_example_storage_engine=1-dwith_zlib=bundled-dwith_ssl=bundled-denabled_local_infile=1-dwith_ embedded_server=1-denable_downloads=1-dwith_debug=0-dwith_boost=/usr/local/boost/

  

5.2. Compiling the installation
# grep Processor/proc/cpuinfo|wc-l
# MAKE-J 6 && make install
-j: Compile with 6 threads to decompress, more compile fast

6. Configure MySQL
6.1. Setting up a soft connection
# ln-s/application/mysql-5.7.19//application/mysql

6.2. Modify the configuration file
# CAT/ETC/MY.CNF
# mysql Config
[Mysqld]
# Datadir=/application/mysql/data
#
# Socket=/application/mysql/tmp/mysql.sock
# Skip-grant-tables
Symbolic-links=0

[Mysqld_safe]
Log-error=/var/log/mysqld.log
Pid-file=/application/mysql/mysqld.pid

7. Initializing the database
7.1. Create Directory/application/mysql-5.7.19/tmp store Mysql.sock
# mkdir/application/mysql-5.7.19/tmp

7.2. Pay all file users under/application/to the MySQL user
# Chown-r mysql.mysql/application/mysql*

7.3. Setting Environment variables
# echo ' path= $PATH:/application/mysql/bin/' >>/etc/profile
# Source/etc/profile

7.4. Configure the Boot file
# Cp/application/mysql/support-files/mysql.server/etc/init.d/mysqld

7.5. Initializing the database
# mysqld--initialize-insecure--user=mysql--basedir=/application/mysql/--datadir=/application/mysql/data

8. Start MySQL
8.1. Start
#/etc/init.d/mysqld Start
# Netstat-lntup |grep 330

8.2. Set on Start
# Chkconfig Mysqld on
# chkconfig Mysqld--list

----------------------------------------------------------------------
# CMAKE Options Explained
-dcmake_install_prefix=/usr/local/mysql//mysql Installation root directory
-dmysql_unix_addr=/usr/local/mysql/mysql.sock//Specify Mysql.sock location
-dmysql_datadir=/data//mysql database File storage directory
-dsysconfdir=/etc the directory where the//mysql configuration file resides
-dwith_myisam_storage_engine=1//Add MYISAM engine
-dwith_innobase_storage_engine=1//Add InnoDB engine
-dwith_archive_storage_engine=1//Add ARCHIVE engine
-dwith_federated_storage_engine=1
-dwith_blackhole_storage_engine=1
-dwithout_example_storage_engine=1
-dwith_partition_storage_engine=1//Support Database partitioning
-dwith_perfschema_storage_engine=1
-dwith_readline=on
-dcompilation_comment= ' ZHAOFX for mysqltest '//
-dextra_charsets=all//enable MySQL to support all extended characters
-ddefault_charset=utf8//Setting the default character set for MySQL to UTF8
-DDEFAULT_COLLATION=UTF8_GENERAL_CI//Set default character set proofing rules
-dwith_systemd=1//can use SYSTEMD to control MySQL service
-dwith_boost=/usr/local/boost//pointing to the directory where the BOOST library is located
-dwith_extra_charsets=all
-dwith_zlib=bundled
-dwith_ssl=bundled
-dwith_innobase_storage_engine=1
-denabled_local_infile=1
-dwith_embedded_server=1
-denable_downloads=1
-dwith_debug=0

MySQL 5.7.19 Source 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.