设为首页 加入收藏

TOP

CentOS 7 下mysql-community-5.7.11编译安装详解(一)
2017-03-30 14:17:22 】 浏览:671
Tags:CentOS mysql-community-5.7.11 编译 安装 详解

安装环境


1、到mysql官网下载mysql-community-5.7.11-1.el7.src.rpm源码包


rpm -ih mysql-community-5.7.11-1.el7.src.rpm会在用户目录下生成一个rpmbuild,从SOURCES文件夹内可以获得源码mysql-5.7.11.tar.gz,解压进入源码目录准备安装


2、因为mysql需要使用cmake编译,直接从yum从光盘的源中找到cmake


[root@localhost ~]# yum info cmake


名称 :cmake
架构 :x86_64
版本 :2.8.11
发布 :4.el7
大小 :6.7 M


3、准备开发环境yum groupinstall Additional Development,yum groupinstall Development tools之前的版本是Development tools和Development Libraries两个软件包组,我这里没有安装,因为只需要gcc和gcc-c++


部分常用编译选项


-- Running cmake version 2.8.11
-- Could NOT find Git (missing: GIT_EXECUTABLE)
-- Configuring with MAX_INDEXES = 64U
-- The C compiler identification is unknown
-- The CXX compiler identification is unknown
CMake Error: your C compiler: "CMAKE_C_COMPILER-NOTFOUND" was not found. Please set CMAKE_C_COMPILER to a valid compiler path or name.
CMake Error: your CXX compiler: "CMAKE_CXX_COMPILER-NOTFOUND" was not found. Please set CMAKE_CXX_COMPILER to a valid compiler path or name.
CMake Error at cmake/os/Linux.cmake:41 (MESSAGE):
Unsupported compiler!
Call Stack (most recent call first):
CMakeLists.txt:162 (INCLUDE)


这是没有安装gcc和gcc-c++


[root@localhost mysql-5.7.11]# yum install gcc gcc-c++


再cmake一次


-- MySQL 5.7.11
-- Packaging as: mysql-5.7.11-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 will look for boost in <directory>. If it is not there,
it will download and unpack it (in that directory) for you.


If you are inside a firewall, you may 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:443 (INCLUDE)



-- Configuring incomplete, errors occurred!


这个就已经说明了You can download it with -DDOWNLOAD_BOOST=1 -DWITH_BOOST=<directory>,Boost库是一个经过千锤百炼、可移植、提供源代码的C++库,作为标准库的后备,是C++标准化进程的发动机之一。


先从boost官网下载这个库boost_1_59_0.tar.gz


解压后把目录添加到-DWITH_BOOST编译选项中


继续编译报错如下


-- Could NOT find Curses (missing: CURSES_LIBRARY CURSES_INCLUDE_PATH)
CMake Error at cmake/readline.cmake:64 (MESSAGE):
Curses library not found. Please install appropriate package,


这个错误是说明缺少Curses库yum install ncurses-devel,需要注意的是每次编译错误都要移除CMakeCache.txt,最后出现 Build files have been written 即成功


CMake Warning:
Manually-specified variables were not used by the project:


DOWNLOAD_BOOST
WITH-LIBWRAP
WITH_MEMORY_STORAGE_ENGINE
WITH_READLINE



-- Build files have been written to: /root/mysql-5.7.11


使用make大约两个小时的样子编译完成,到百分之五十几的时候停留的时间比较长。



make install


出现一堆安装信息即完成安装


-- Installing: /usr/local/mysql/mysql-test/./cmake_install.cmake
-- Installing: /usr/local/mysql/mysql-test/./CTestTestfile.cmake
-- Up-to-date: /usr/local/mysql/mysql-test/mtr
-- Up-to-date: /usr/local/mysql/mysql-test/mysql-test-run
-- Installing: /usr/local/mysql/mysql-test/lib/My/SafeProcess/my_safe_process
-- Up-to-date: /usr/local/mysql/mysql-test/lib/My/SafeProcess/my_safe_process
-- Installing: /usr/local/mysql/mysql-test/lib/My/SafeProcess/Base.pm
-- Installing: /usr/local/mysql/support-files/my-default.cnf
-- Installin

首页 上一页 1 2 下一页 尾页 1/2/2
】【打印繁体】【投稿】【收藏】 【推荐】【举报】【评论】 【关闭】 【返回顶部
上一篇Oracle开启并行的几种方法 下一篇Zabbix自定义监控MySQL性能状态

最新文章

热门文章

Hot 文章

Python

C 语言

C++基础

大数据基础

linux编程基础

C/C++面试题目