Mysql 5.7.17 Compilation Installation

Source: Internet
Author: User

Environment Preparation:

MySQL installation package: mysql-5.7.17.tar.gz


Yum Source:

[Email protected]_1 ~]# Cat/etc/yum.repos.d/server.repo

[Local]

Name=local

Baseurl=file:///mnt/cdrom

Gpgcheck=0

Enabled=1

[[Email Protected]_1 ~]#


System version:

[Email protected]_1 ~]# cat/etc/redhat-release

CentOS Linux release 7.2.1511 (Core)

[Email protected]_1 ~]# uname-r

3.10.0-327.el7.x86_64


To install a dependency package:

[Email protected]_1 mysql-5.7.17]# Yum install-y libaio-devel ncurses-devel cmake gcc-c++ Bison


Create user and Unzip:

[[Email protected]_1 mysql-5.7.17]# useradd-s/sbin/nologin-m MySQL

[Email protected]_1 mysql-5.7.17] #mkdir-P/data/3307/data

[Email protected]_1 mysql-5.7.17]# Tar XF mysql-5.7.17.tar.gz

[Email protected]_1 mysql-5.7.17]# CD mysql-5.7.17/

Compile and install:

[Email protected]_1 mysql-5.7.17]# cmake-dcmake_install_prefix=/usr/local/mysql-5.7.17/-DMYSQL_DATADIR=/usr/ Local/mysql-5.7.17/data-dmysql_unix_addr=/usr/local/mysql-5.7.17/tmp/mysql.sock-ddefault_charset=utf8-ddefault _collation=utf8_general_ci-dextra_charsets=gbk,gb2312,utf8,ascii-denabled_loocal_infile=on-dwith_innobase_ Storage_engine=1-dwith_federated_storage_engine=1-dwith_blackhole_storage_engine=1-dwithout_example_storage_ Engine=1-dwithout_parrtition_storage_engine=1-dwith_fast_mutexes=1-dwith_zlib=bundled-denabled_local_infile=1- Dwith_readline=1-dwith_embedded_server=1-dwith_debug=0

--Running CMake version 2.8.11

--Could not find Git (missing:git_executable)

--Configuring with max_indexes = 64U

--SIZEOF_VOIDP 8

--MySQL 5.7.17

--Packaging as:mysql-5.7.17-linux-x86_64

--looked for boost/version.hpp in and

--Boost_include_dir Boost_include_dir-notfound

--Local_boost_dir

--Local_boost_zip

--Could not find (the correct version of) boost.

--MySQL currently requires BOOST_1_59_0


CMake Error at cmake/boost.cmake:81 (MESSAGE):

You can download it with-ddownload_boost=1-dwith_boost=<directory>


This CMake script would look-for-boost in <directory> If It is not there,

It'll download and unpack it (in this directory) for you.


If you were inside a firewall, you could need to use an HTTP proxy:


Export http_proxy=http://example.com:80


Call Stack (most recent call first):

cmake/boost.cmake:238 (Could_not_find_boost)

cmakelists.txt:455 (INCLUDE)



--Configuring incomplete, Errors occurred!



Compile error!!!!!


From the red part of the mark can be seen is a lack of reliance on Google to find a solution

mysql5.7.5 need boost after all.

: https://sourceforge.net/projects/boost/files/boost/1.59.0/


Install boost:

[Email protected]_1 mysql-5.7.17]# tar-xf boost_1_59_0.tar.gz

[Email protected]_1 mysql-5.7.17]# CD boost_1_59_0/

[Email protected]_1 mysql-5.7.17]# mkdir/usr/local/boost

[Email protected]_1 mysql-5.7.17]# cp-a./*/usr/local/boost/



Compile again (Specify the boost path):

#增加了boost路径-dwith_boost

[email protected]_1 mysql-5.7.17]# cmake \

-dcmake_install_prefix=/usr/local/mysql \

-dmysql_datadir=/data/3307/data \ #自定义目录

-dsysconfdir=/data/3307 \ #自定义目录

-dmysql_user=mysql \

-dwith_myisam_storage_engine=1 \

-dwith_innobase_storage_engine=1 \

-dwith_archive_storage_engine=1 \

-dwith_memory_storage_engine=1 \

-dwith_readline=1 \

-dmysql_unix_addr=/data/3307/mysql.sock \ #自定义目录

-dmysql_tcp_port=3307 \ #自定义端口

-denabled_local_infile=1 \

-denable_downloads=1 \

-dwith_partition_storage_engine=1 \

-dextra_charsets=all \

-ddefault_charset=utf8 \

-DDEFAULT_COLLATION=UTF8_GENERAL_CI \

-dwith_debug=0 \

-dmysql_maintainer_mode=0 \

-dwith_ssl:string=bundled \

-dwith_zlib:string=bundled \

-dwith_boost=/usr/local/boost


[[Email protected]_1 mysql-5.7.17]# make && make install


The following error is reported in the Make process!!!



[75%] Built Target Sqlgunitlib

[75%] Building CXX Object UNITTEST/GUNIT/CMAKEFILES/MERGE_SMALL_TESTS-T.DIR/MERGE_SMALL_TESTS.CC.O

C + +: Internal compiler error:killed (program Cc1plus)

Please submit a full bug report,

With preprocessed source if appropriate.

See

MAKE[2]: * * * [UNITTEST/GUNIT/CMAKEFILES/MERGE_SMALL_TESTS-T.DIR/MERGE_SMALL_TESTS.CC.O] Error 4

MAKE[1]: * * * [Unittest/gunit/cmakefiles/merge_small_tests-t.dir/all] Error 2

Make: * * * [ALL] Error 2


Google found that the memory is not enough swap partition is not enough

Solution:


[[Email protected]_1 ~]# dd If=/dev/zero of=/swapfile bs=1k count=2048000

[Email protected]_1 ~]# mkswap/swapfile

[Email protected]_1 ~]# swapon/swapfile

Initialization
[Email protected]_1 3307]# mysqld--defaults-file=/data/3307/my.cnf--initialize-insecure--user=mysql

Start the service:

[Email protected]_1 3307]# mysqld_safe--user=mysql &

[Email protected]_1 data]# mysql-uroot

Welcome to the MySQL Monitor. Commands End With; or \g.

Your MySQL Connection ID is 3

Server Version:5.7.17-log Source Distribution


Copyright (c), Oracle and/or its affiliates. All rights reserved.


Oracle is a registered trademark of the Oracle Corporation and/or its

Affiliates. Other names trademarks of their respective

Owners.


Type ' help ', ' or ' \h ' for help. Type ' \c ' to clear the current input statement.


mysql> show databases;

+--------------------+

| Database |

+--------------------+

| Information_schema |

| MySQL |

| Performance_schema |

| SYS |

+--------------------+

4 rows in Set (0.00 sec)


Mysql>


Installation is complete!

This article is from "Dream 1 game ー〉╯" blog, please make sure to keep this source http://cqwujiang.blog.51cto.com/10808946/1900875

Mysql 5.7.17 Compilation 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.