centos
mysql5.6.27
1编译安装
先进入到文件放置的路径下
创建一个个文件
#mkdir–p /data/mysql/mysql
#mkdir–p /data/mysql/mysqldat
2创建用户和用户组
groupadd mysql
useradd -r -g mysql mysql
3赋予数据存放目录权限
chown mysql:mysql -R /data/mysql/mysqldata/
4解压
tar -xvf mysql-5.6.27.tar.gz
5安装cmake
yum -install cmake -y
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
– Running cmake version 2.8.12.2
– Could NOT find Git (missing: GIT_EXECUTABLE)
– 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:27 (STRING):
string sub-command REPLACE requires at least four arguments.
Call Stack (most recent call first):
CMakeLists.txt:149 (INCLUDE)
CMake Error at cmake/os/Linux.cmake:27 (STRING):
string sub-command REPLACE requires at least four arguments.
Call Stack (most recent call first):
CMakeLists.txt:149 (INCLUDE)
– MySQL 5.6.27
– Packaging as: mysql-5.6.27-Linux-i686
– Could NOT find Threads (missing: Threads_FOUND)
– Could NOT find Threads (missing: Threads_FOUND)
– Check if the system is big endian
– Searching 16 bit integer
CMake Error at /usr/share/cmake/Modules/TestBigEndian.cmake:44 (message):
no suitable type found
Call Stack (most recent call first):
configure.cmake:628 (TEST_BIG_ENDIAN)
CMakeLists.txt:398 (INCLUDE)
– Configuring incomplete, errors occurred!
See also “/usr/local/src/mysql-5.6.27/CMakeFiles/CMakeOutput.log”.
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
继续
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
出现错误:
CMake Error: The following variables are used in this project, but they are set to NOTFOUND.
Please set them or make sure they are set and tested correctly in the CMake files:
OPENSSL_INCLUDE_DIR
used as include directory in directory /usr/local/src/mysql-5.6.27/CMakeFiles/CMakeTmp
CMake Error: Internal CMake error, TryCompile configure of cmake failed
– Check size of wchar_t - failed
– Check size of wctype_t
CMake Error: The following variables are used in this project, but they are set to NOTFOUND.
Please set them or make sure they are set and tested correctly in the CMake files:
OPENSSL_INCLUDE_DIR
used as include directory in directory /usr/local/src/mysql-5.6.27/CMakeFiles/CMakeTmp
CMake Error: Internal CMake error, TryCompile configure of cmake failed
– Check size of wctype_t - failed
– Check size of wint_t
CMake Error: The following variables are used in this project, but they are set to NOTFOUND.
Please set them or make sure they are set and tested correctly in the CMake files:
OPENSSL_INCLUDE_DIR
used as include directory in directory /usr/local/src/mysql-5.6.27/CMakeFiles/CMakeTmp
CMake Error: Internal CMake error, TryCompile configure of cmake failed
– Check size of wint_t - failed
– Could NOT find Curses (missing: CURSES_LIBRARY CURSES_INCLUDE_PATH)
CMake Error at cmake/readline.cmake:85 (MESSAGE):
Curses library not found. Please install appropriate package,
remove CMakeCache.txt and rerun cmake.On Debian/Ubuntu, package name is libncurses5-dev, on Redhat and derivates it is ncurses-devel.
Call Stack (most recent call first):
cmake/readline.cmake:128 (FIND_CURSES)
cmake/readline.cmake:202 (MYSQL_USE_BUNDLED_EDITLINE)
CMakeLists.txt:409 (MYSQL_CHECK_EDITLINE)
– Configuring incomplete, errors occurred!
See also “/usr/local/src/mysql-5.6.27/CMakeFiles/CMakeOutput.log”.
See also “/usr/local/src/mysql-5.6.27/CMakeFiles/CMakeError.log”.
分析:
– 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
重新
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:
– Running cmake version 2.8.12.2
– MySQL 5.6.27
– Packaging as: mysql-5.6.27-Linux-x86_64
– HAVE_VISIBILITY_HIDDEN
– HAVE_VISIBILITY_HIDDEN
– HAVE_VISIBILITY_HIDDEN
– Using cmake version 2.8.12.2
– Not building NDB
– Library mysqlclient depends on OSLIBS -lpthread;m;rt;dl
Warning: Bison executable not found in PATH
– Library mysqlserver depends on OSLIBS -lpthread;m;rt;crypt;dl
– CMAKE_BUILD_TYPE: RelWithDebInfo
– COMPILE_DEFINITIONS: HAVE_CONFIG_H
– CMAKE_C_FLAGS: -Wall -Wextra -Wformat-security -Wvla -Wwrite-strings -Wdeclaration-after-statement
– CMAKE_CXX_FLAGS: -Wall -Wextra -Wformat-security -Wvla -Woverloaded-virtual -Wno-unused-parameter
– CMAKE_C_FLAGS_RELWITHDEBINFO: -O3 -g -fabi-version=2 -fno-omit-frame-pointer -fno-strict-aliasing -DDBUG_OFF
– CMAKE_CXX_FLAGS_RELWITHDEBINFO: -O3 -g -fabi-version=2 -fno-omit-frame-pointer -fno-strict-aliasing -DDBUG_OFF
– Configuring done
– Generating done
– 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
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
6.make && make install
7.chown -R mysql:mysql /usr/local/mysql/
8.cd /usr/local/mysql/
9. ./scripts/mysql_install_db --user=mysql --datadir=/data/mysql 初始化
10. cp support-files/my-default.cnf /etc/my.cnf
11. cp support-files/mysql.server /etc/init.d/mysqld
12. chmod 755 /etc/init.d/mysqld
13.vim /etc/init.d/mysqld 修改datadir=/data/mysql
14.service mysqld start
15ln -s /usr/local/mysql/bin/mysql /usr/bin
16mysql -u root -p没密码
成功启动Starting MySQL… SUCCESS!

linux篇-linux mysql5.6.27源码安装和错误解决的更多相关文章

  1. mysql-5.6.27源码安装及错误解决办法

    wget http://mirrors.sohu.com/mysql/MySQL-5.6/mysql-5.6.27.tar.gz yum install -y cmake  当然也可以自己下载源码包安 ...

  2. mysql-5.5.28源码安装过程中错误总结

    介绍一下关于mysql-5.5.28源码安装过程中几大错误总结,希望此文章对各位同学有所帮助.系统centOS 6.3 mini (没有任何编译环境)预编译环境首先装了众所周知的 cmake(yum ...

  3. mysql-5.7.25 源码 安装

    mysql-5.7.25 源码 安装 编译 export INSTALL_PREFIX="/data/services" export MYSQL_INSTALL_PATH=&qu ...

  4. MySQL5.7.20源码安装以及pt-query-digest用法示例

    MySQL5.7.20源码安装1.下载解压cd /data/app/mysql5.7wget https://dev.mysql.com/get/Downloads/MySQL-5.7/mysql-5 ...

  5. Linux下rabitMq的部署(源码安装)

    简版yum安装:https://www.jianshu.com/p/46c22834aad5 一.环境安装 1,安装预环境 通过yum安装以下组件,运行命令: [root@rabbitmqserver ...

  6. RHEL Server 6.3下MySQL5.5.25a源码安装

    OS:RHEL Server 6.3 MySQL:mysql-5.5.25a.tar.gz 相关依赖包: ncurses-5.9.tar.gz bison-2.5.tar.gz 安装MySQL 一.安 ...

  7. mysql5.7.17源码安装

    创建用户和目录 groupadd mysql useradd -r -g mysql mysql mkdir -p /data/mysql/standby/data mkdir -p /data/my ...

  8. 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 ...

  9. CentOS 6.5 MySQL5.6.26源码安装

    一.源码安装cmake工具 从mysql5.5起,mysql源码安装开始使用cmake wget http://cmake.org/files/v3.2/cmake-3.2.3.tar.gztar z ...

随机推荐

  1. mplab使用小知识

    选择Debugger->Select Tool->MPLAB SIM可以使用MPALB中的软件调试 StopWatch可以观察程序运行时间 注意:在测试时需要注意红圈内晶振是不是和单片机上 ...

  2. 3.3转1.8V(电平转换)

  3. dll反编译(修改引用文件、修改代码)再生成dll

    问题描述 我们在日常开发中经常会遇到,想要对dll文件做修改的操作,但苦于没有源代码,只能想想其他办法 解决问题 办法就是通过几个工具来反编译.正向编译.修改属性 反编译.正编译 参考https:// ...

  4. github 上有趣又实用的前端项目(持续更新,欢迎补充)

    github 上有趣又实用的前端项目(持续更新,欢迎补充) 1. reveal.js: 幻灯片展示框架 一个专门用来做 HTML 幻灯片的框架,支持 HTML 和 Markdown 语法. githu ...

  5. 聊一聊Web端的即时通讯

    聊一聊Web端的即时通讯 Web端实现即时通讯的方法有哪些? - 短轮询 长轮询 iframe流 Flash Socket 轮询 客户端定时向服务器发送Ajax请求,服务器接到请求后马上返回响应信息并 ...

  6. python-爬楼梯

    [题目描述] 假设一段楼梯共n(n>1)个台阶,小朋友一步最多能上3个台阶,那么小朋友上这段楼梯一共有多少种方法. [练习要求]请给出源代码程序和运行测试结果,源代码程序要求添加必要的注释. [ ...

  7. Python网络爬虫 - 爬取中证网银行相关信息

    最终版:07_中证网(Plus -Pro).py # coding=utf-8 import requests from bs4 import BeautifulSoup import io impo ...

  8. Android搞定权限申请

    0x00 前言 使用EasyPermissions库进行申请权限 打开App时就申请权限,如果用户拒绝权限后,会循环申请 如果永久拒绝后,会跳转到设置里继续申请 效果图: 注:不讲原理,先教你怎么实现 ...

  9. GopherCon SG 2019 "Understanding Allocations" 学习笔记

    本篇是根据 GopherCon SG 2019 "Understanding Allocations" 演讲的学习笔记. Understanding Allocations: th ...

  10. 学习day44

    初步学完html的知识