1. wget http://mirrors.sohu.com/mysql/MySQL-5.6/mysql-5.6.27.tar.gz

  2. yum install -y cmake  当然也可以自己下载源码包安装,为方便就Yum安装了

  3. useradd -s /sbin/nologin mysql

  4. tar zxvf mysql-5.6.27.tar.gz

  5. mkdir -p /data/mysql

  6. chown -R mysql:mysql /data/mysql

  7. cd mysql-5.6.27

    1. cmake . -DCMAKE_INSTALL_PREFIX=/usr/local/mysql -DMYSQL_DATADIR=/mysql/data -DDEFAULT_CHARSET=utf8  -DDEFAULT_COLLATION=utf8_general_ci -DWITH_EXTRA_CHARSETS:STRING=all -DWITH_DEBUG=0  -DENABLED_LOCAL_INFILE=1
  1. -- Running cmake version 2.8.12.2
  2. -- Could NOT find Git (missing:  GIT_EXECUTABLE)
  3. -- The C compiler identification is unknown
  4. -- The CXX compiler identification is unknown
  5. CMake Error: your C compiler: "CMAKE_C_COMPILER-NOTFOUND" was not found.   Please set CMAKE_C_COMPILER to a valid compiler path or name.
  6. CMake Error: your CXX compiler: "CMAKE_CXX_COMPILER-NOTFOUND" was not found.   Please set CMAKE_CXX_COMPILER to a valid compiler path or name.
  7. CMake Error at cmake/os/Linux.cmake:27 (STRING):
  8.   string sub-command REPLACE requires at least four arguments.
  9. Call Stack (most recent call first):
  10.   CMakeLists.txt:149 (INCLUDE)
  11. CMake Error at cmake/os/Linux.cmake:27 (STRING):
  12.   string sub-command REPLACE requires at least four arguments.
  13. Call Stack (most recent call first):
  14.   CMakeLists.txt:149 (INCLUDE)
  15. -- MySQL 5.6.27
  16. -- Packaging as: mysql-5.6.27-Linux-i686
  17. -- Could NOT find Threads (missing:  Threads_FOUND)
  18. -- Could NOT find Threads (missing:  Threads_FOUND)
  19. -- Check if the system is big endian
  20. -- Searching 16 bit integer
  21. CMake Error at /usr/share/cmake/Modules/TestBigEndian.cmake:44 (message):
  22.   no suitable type found
  23. Call Stack (most recent call first):
  24.   configure.cmake:628 (TEST_BIG_ENDIAN)
  25.   CMakeLists.txt:398 (INCLUDE)
  26. -- Configuring incomplete, errors occurred!
  27. See also "/usr/local/src/mysql-5.6.27/CMakeFiles/CMakeOutput.log".
  28. See also "/usr/local/src/mysql-5.6.27/CMakeFiles/CMakeError.log".

分析:

-- Could NOT find Git (missing:  GIT_EXECUTABLE)这项应该缺少git包,yum install -y git

-- The C compiler identification is unknown

-- The CXX compiler identification is unknown 这两项缺少gcc和gcc-c++的包,yum install -y gcc gcc-c++

另外需要rm CMakeCache.txt

继续

  1. cmake . -DCMAKE_INSTALL_PREFIX=/usr/local/mysql -DMYSQL_DATADIR=/mysql/data -DDEFAULT_CHARSET=utf8  -DDEFAULT_COLLATION=utf8_general_ci -DWITH_EXTRA_CHARSETS:STRING=all -DWITH_DEBUG=0 -DWITH_SSL=yes -DWITH_READLINE=1 -DENABLED_LOCAL_INFILE=1

出现错误:

  1. CMake Error: The following variables are used in this project, but they are set to NOTFOUND.
  2. Please set them or make sure they are set and tested correctly in the CMake files:
  3. OPENSSL_INCLUDE_DIR
  4.    used as include directory in directory /usr/local/src/mysql-5.6.27/CMakeFiles/CMakeTmp
  5. CMake Error: Internal CMake error, TryCompile configure of cmake failed
  6. -- Check size of wchar_t - failed
  7. -- Check size of wctype_t
  8. CMake Error: The following variables are used in this project, but they are set to NOTFOUND.
  9. Please set them or make sure they are set and tested correctly in the CMake files:
  10. OPENSSL_INCLUDE_DIR
  11.    used as include directory in directory /usr/local/src/mysql-5.6.27/CMakeFiles/CMakeTmp
  12. CMake Error: Internal CMake error, TryCompile configure of cmake failed
  13. -- Check size of wctype_t - failed
  14. -- Check size of wint_t
  15. CMake Error: The following variables are used in this project, but they are set to NOTFOUND.
  16. Please set them or make sure they are set and tested correctly in the CMake files:
  17. OPENSSL_INCLUDE_DIR
  18.    used as include directory in directory /usr/local/src/mysql-5.6.27/CMakeFiles/CMakeTmp
  19. CMake Error: Internal CMake error, TryCompile configure of cmake failed
  20. -- Check size of wint_t - failed
  21. -- Could NOT find Curses (missing:  CURSES_LIBRARY CURSES_INCLUDE_PATH)
  22. CMake Error at cmake/readline.cmake:85 (MESSAGE):
  23.   Curses library not found.  Please install appropriate package,
  24.       remove CMakeCache.txt and rerun cmake.On Debian/Ubuntu, package name is libncurses5-dev, on Redhat and derivates it is ncurses-devel.
  25. Call Stack (most recent call first):
  26.   cmake/readline.cmake:128 (FIND_CURSES)
  27.   cmake/readline.cmake:202 (MYSQL_USE_BUNDLED_EDITLINE)
  28.   CMakeLists.txt:409 (MYSQL_CHECK_EDITLINE)
  29. -- Configuring incomplete, errors occurred!
  30. See also "/usr/local/src/mysql-5.6.27/CMakeFiles/CMakeOutput.log".
  31. See also "/usr/local/src/mysql-5.6.27/CMakeFiles/CMakeError.log".

分析:

  1. -- Could NOT find Curses (missing:  CURSES_LIBRARY CURSES_INCLUDE_PATH)

缺少ncurses-devel包,yum install -y ncurses-devel

rm CMakeCache.txt

通过阅读官方文件http://dev.mysql.com/doc/refman/5.6/en/source-configuration-options.html,去除选项-DWITH_READLINE=1和-DWITH_SSL=YES

重新

  1.  cmake -DCMAKE_INSTALL_PREFIX=/usr/local/mysql -DMYSQL_DATADIR=/data/mysql -DDEFAULT_CHARSET=utf8  -DDEFAULT_COLLATION=utf8_general_ci -DWITH_EXTRA_CHARSETS:STRING=all -DWITH_DEBUG=0  -DENABLED_LOCAL_INFILE=1

出现warning:

  1. -- Running cmake version 2.8.12.2
  2. -- MySQL 5.6.27
  3. -- Packaging as: mysql-5.6.27-Linux-x86_64
  4. -- HAVE_VISIBILITY_HIDDEN
  5. -- HAVE_VISIBILITY_HIDDEN
  6. -- HAVE_VISIBILITY_HIDDEN
  7. -- Using cmake version 2.8.12.2
  8. -- Not building NDB
  9. -- Library mysqlclient depends on OSLIBS -lpthread;m;rt;dl
  10. Warning: Bison executable not found in PATH
  11. -- Library mysqlserver depends on OSLIBS -lpthread;m;rt;crypt;dl
  12. -- CMAKE_BUILD_TYPE: RelWithDebInfo
  13. -- COMPILE_DEFINITIONS: HAVE_CONFIG_H
  14. -- CMAKE_C_FLAGS:  -Wall -Wextra -Wformat-security -Wvla -Wwrite-strings -Wdeclaration-after-statement
  15. -- CMAKE_CXX_FLAGS:  -Wall -Wextra -Wformat-security -Wvla -Woverloaded-virtual -Wno-unused-parameter
  16. -- CMAKE_C_FLAGS_RELWITHDEBINFO: -O3 --fabi-version=2 -fno-omit-frame-pointer -fno-strict-aliasing -DDBUG_OFF
  17. -- CMAKE_CXX_FLAGS_RELWITHDEBINFO: -O3 --fabi-version=2 -fno-omit-frame-pointer -fno-strict-aliasing -DDBUG_OFF
  18. -- Configuring done
  19. -- Generating done
  20. -- Build files have been written to: /usr/local/src/mysql-5.6.27

分析:Warning: Bison executable not found in PATH  缺少Bison,yum install -y bison

  1.  cmake -DCMAKE_INSTALL_PREFIX=/usr/local/mysql -DMYSQL_DATADIR=/data/mysql -DDEFAULT_CHARSET=utf8  -DDEFAULT_COLLATION=utf8_general_ci -DWITH_EXTRA_CHARSETS:STRING=all -DWITH_DEBUG=0  -DENABLED_LOCAL_INFILE=1

echo $? 是0代表OK

9.make && make install

10.chown -R mysql:mysql /usr/local/mysql/

11.cd /usr/local/mysql/

12. ./scripts/mysql_install_db --user=mysql --datadir=/data/mysql 初始化

13. cp support-files/my-default.cnf /etc/my.cnf

14. cp support-files/mysql.server /etc/init.d/mysqld

15. chmod 755 /etc/init.d/mysqld

16.vim /etc/init.d/mysqld   修改datadir=/data/mysql

19.service mysqld start

成功启动Starting MySQL.. SUCCESS!

本文出自 “echo xiayun” 博客,原链接为http://linuxerxy.blog.51cto.com/10707334/1728571

mysql-5.6.27源码安装及错误解决办法的更多相关文章

  1. linux篇-linux mysql5.6.27源码安装和错误解决

    centos mysql5.6.27 1编译安装 先进入到文件放置的路径下 创建一个个文件 #mkdir–p /data/mysql/mysql #mkdir–p /data/mysql/mysqld ...

  2. MySQL学习之路 一 : MySQL 5.7.19 源码安装

    MySQL 5.7.19 源码安装 查看系统: # cat /etc/redhat-release CentOS Linux release 7.3.1611 (Core) 安装依赖包 # yum - ...

  3. LNMP架构下的nginx、mysql、php的源码安装

    一.LNMP的介绍 LNMP就是Linux+Nginx+Mysql+Php这种网站服务架构.Linux是一类Unix计算机操作系统的统称,是目前最流行的免费操作系统,常见版本有:centos.ubun ...

  4. PHP-5.3.27源码安装及nginx-fastcgi配置

    源码安装php cat /etc/redhat-release uname -rm wget -O /etc/yum.repos.d/epel.repo http://mirrors.aliyun.c ...

  5. mysql 在cento下源码安装

    虚拟机改为网络地址转换 (NAT) service network restartping www.baidu.com rpm -qa | grep mysql 有的话通过下面的命令来卸载掉 rpm ...

  6. 数据库的硬迁移和mysql 5.5.38源码安装

    场景:一台服务器出现了故障,需要把数据库迁移到另一台服务器上,由于数据效大,直接压缩数库的数据目录(在数据库DOWN的情况下)数据库版本mysql 5.5.38安装方式:源码安装思路:在另一台服务器上 ...

  7. mysql 5.7.18 源码安装笔记

    之所以贴出这样一篇笔记呢?主要是因为很久之前,源码安装MySQL的时候,碰到了太多太多的坎坷. 如果你有兴趣进行源码安装,那么请不要以这篇文章为标准,因为每个人的及其环境等其他因素还是差距比较大的. ...

  8. linux应用之Lamp(apache+mysql+php)的源码安装(centos)

    Linux+Apache+Mysql+Php源码安装 一.安装环境: 系统:Centos6.5x64 Apache: httpd-2.4.10.tar.gz Mysql: mysql-5.6.20-l ...

  9. redis 安装 与错误解决办法

    redis 安装与安装中遇到的错误 redis 安装 wget http://download.redis.io/releases/redis-4.0.11.tar.gz .tar.gz cd red ...

随机推荐

  1. K贪心

    <span style="color:#330099;">/* K - 贪心 基础 Time Limit:1000MS Memory Limit:32768KB 64b ...

  2. java获取当前系统毫秒,纳秒

    //获取当前系统毫秒 System.out.println(System.currentTimeMillis()); //获取当前系统纳秒 System.out.println(System.nano ...

  3. MySql命令——游标

    1.游标的概念 有时,需要在检索出来的行中前进或后退一行或多行.这就是使用游标的原因.游标(cursor)是一个存储在 MySql 服务器上的数据库查询,它不是一条 select 语句,而是被该语句检 ...

  4. Sql server Lock

    http://www.cnblogs.com/wuyifu/archive/2013/11/28/3447870.html

  5. ASP.NET 后台下载文件方法

    void DownLoadFile(string fileName) { string filePath = Server.MapPath(fileName);//路径 //以字符流的形式下载文件 F ...

  6. ongl三种符号的使用

    1.#符号 访问非根对象属性,由于Struts2中值栈被视为根对象,所以访问其他非根对象时,需要加#前缀.实际上,#相当于ActionContext.getContext(): 用于过滤和投影(pro ...

  7. A Typical Homework(学生信息管理系统)

    A Typical Homework(a.k.a Shi Xiong Bang Bang Mang) Hi, I am an undergraduate student in institute of ...

  8. Nubiers to follow

    VGG Andrea Vedaldi Berkeley Trevor Darrell Jeff Donahue Ross Girshick Sergio Guadarrama Stanford And ...

  9. struts2的注解配置全面解析

    以前在用struts2的注解配置时总是要在web.xml中配置一个初始化参数(actionPackages),最近发现不灵了,仔细研究了下发现即使不用在web.xml中配置也能成功,但时灵时不灵的,很 ...

  10. 解决ScrollView中嵌套ListView滚动效果冲突问题

    在ScrollView中嵌套使用ListView,ListView只会显示一行到两行的数据.起初我以为是样式的问题,一直在对XML文件的样 式进行尝试性设置,但始终得不到想要的效果.后来在网上查了查, ...