MySQL 源码编译安装报错 CMake Error: CMAKE_CXX_COMPILER not set, after EnableLanguage

今天编译安装mysql 5.6.27的时候报错。

执行命令:

shell> cmake . \
> -DCMAKE_INSTALL_PREFIX=/usr/local/mysql \
> -DMYSQL_DATADIR=/usr/local/mysql/data \
> -DDEFAULT_CHARSET=utf8 \
> -DDEFAULT_COLLATION=utf8_general_ci \
> -DEXTRA_CHARSETS=all \
> -DENABLED_LOCAL_INFILE=1 \
> -DENABLE_DOWNLOADS=1


报错信息:

-- Not building NDB
-- Performing Test HAVE_PEERCRED
CMake Error at /usr/share/cmake/Modules/CMakeCXXInformation.cmake:17 (GET_FILENAME_COMPONENT):
  get_filename_component called with incorrect number of arguments
Call Stack (most recent call first):
  CMakeLists.txt:3 (PROJECT)
CMake Error: CMAKE_CXX_COMPILER not set, after EnableLanguage
CMake Error: Internal CMake error, TryCompile configure of cmake failed
-- Performing Test HAVE_PEERCRED - Failed
-- Library mysqlclient depends on OSLIBS -lpthread;m;rt;dl
-- Download failed, error: 7;"Couldn't connect to server"

解决方法:

yum install gcc-c++
rm -f CMakeCache.txt
重新编译安装









你可能感兴趣的:(MYSQL,安装,&,启动)