软件P>2个月前公司给DBA的测试服CPU收回去了,一直跟开发用一组DB,有些需要测试的小功能,需要不断重启db,为了不影响开发同事,自己又申请了一个虚拟机,准备安装最新的5.6.13版本的MySQL社区版 。
1 download the tar.gz
wget http://dev.mysql.com/get/Downloads/MySQL-5.6/mysql-5.6.13.tar.gz/from/http://cdn.mysql.com/
2 安装cmake软件包
yum install cmake
3 create account of mysql
groupadd mysql
useradd -g mysql mysql
autoreconf --force --install
libtoolize --automake --force
automake --force --add-missing
4 complie the sources
mkdir -p /data/mbdata
tar -xvf mysql-5.6.13.tar.gz
5 cmake
time cmake . -DCMAKE_INSTALL_PREFIX=/usr/local/mysql56 -DMYSQL_DATADIR=/data56 -DWITH_INNOBASE_STORAGE_ENGINE=1 -DMYSQL_UNIX_ADDR==/data56/mysql.sock -DMYSQL_USER=mysql -DDEFAULT_CHARSET=utf8 -DDEFAULT_COLLATION=utf8_general_ci
[root@472322 mysql-5.6.13]# time cmake . -DCMAKE_INSTALL_PREFIX=/usr/local/mysql56 -DMYSQL_DATADIR=/data56 -DWITH_INNOBASE_STORAGE_ENGINE=1 -DMYSQL_UNIX_ADDR==/data56/mysql.sock -DMYSQL_USER=mysql -DDEFAULT_CHARSET=utf8 -DDEFAULT_COLLATION=utf8_general_ci
-- Running cmake version 2.6.4
CMake Error: CMake was unable to find a build program corresponding to "Unix Makefiles". CMAKE_MAKE_PROGRAM is not set. You probably need to select a different build tool.
CMake Error: Error required internal CMake variable not set, cmake may be not be built correctly.
Missing variable is:
CMAKE_C_COMPILER_ENV_VAR
CMake Error: Error required internal CMake variable not set, cmake may be not be built correctly.
Missing variable is:
CMAKE_C_COMPILER
CMake Error: Could not find cmake module file:/root/mysql-5.6.13/CMakeFiles/CMakeCCompiler.cmake
CMake Error: Error required internal CMake variable not set, cmake may be not be built correctly.
Missing variable is:
CMAKE_CXX_COMPILER_ENV_VAR
CMake Error: Error required internal CMake variable not set, cmake may be not be built correctly.
Missing variable is:
CMAKE_CXX_COMPILER
CMake Error: Could not find cmake module file:/root/mysql-5.6.13/CMakeFiles/CMakeCXXCompiler.cmake
CMake Error: CMAKE_C_COMPILER not set, after EnableLanguage
CMake Error: CMAKE_CXX_COMPILER not set, after EnableLanguage
-- Configuring incomplete, errors occurred!
real 0m0.017s
user 0m0.006s
sys 0m0.005s
6 上一步cmake报错了,google得知需要重新yum make下
再继续去cmake
[root@472322 mysql-5.6.13]# time cmake . -DCMAKE_INSTALL_PREFIX=/usr/local/mysql56 -DMYSQL_DATADIR=/data56 -DWITH_INNOBASE_STORAGE_ENGINE=1 -DMYSQL_UNIX_ADDR==/data56/mysql.sock -DMYSQL_USER=mysql -DDEFAULT_CHARSET=utf8 -DDEFAULT_COLLATION=utf8_general_ci
-- Running cmake version 2.6.4
-- 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.
-- MySQL 5.6.13
-- Packaging as: mysql-5.6.13-Linux-x86_64
-- 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:31 (MESSAGE):
no suitable type found
Call Stack (most recent call first):
configure.cmake:621 (TEST_BIG_ENDIAN)
CMakeLists.txt:314 (INCLUDE)
这个错误很诡异,google上面有很多,但是每种情况都不同,我只好一个个去try了
-- Configuring incomplete, errors occurred!
real 0m0.122s
user 0m0.067s
sys 0m0.048s
[root@472322 mysql-5.6.13]#
报错如下: CMake Error: your C compiler: "CMAKE_C_COMPILER-NOTFOUND" was not found.
没有安装 gcc 和 gcc-c++,执行cmake报如上错误:
第一次尝试,执行
yum install -y gcc
yum install -y gcc-c++
Ok,yum成功
7 继续cmake
time cmake . -DCMAKE_INSTALL_PREFIX=/usr/local/mysql56 -DMYSQL_DATADIR=/data56 -DWITH_INNOBASE_STORAGE_ENGINE=1 -DMYSQL_UNIX_ADDR==/data56/mysql.sock -DMYSQL_USER=mysql -DDEFAULT_CHARSET=utf8 -DDEFAULT_COLLATION=utf8_general_ci
--转自