MySQL编译安装-出现错误提示


  

环境:

系统:centos7.6

MySQL:5.6.3

cmake:2.8.6

原因:

  安装ncurses-devel运行环境

    [root@localhost ~]# yum -y install ncurses-devel

  成功后:

    [root@controller cmake-2.8.6]# ./configure

报错内容:

[root@controller cmake-2.8.6]# ./configure --------------------------------------------- CMake 2.8.6, Copyright 2000-2009 Kitware, Inc. --------------------------------------------- Error when bootstrapping CMake: Cannot find appropriate C compiler on this system. Please specify one using environment variable CC. See cmake_bootstrap.log for compilers attempted.   --------------------------------------------- Log of errors: /usr/src/cmake-2.8.6/Bootstrap.cmk/cmake_bootstrap.log ---------------------------------------------

解决:

此时如果我们在命令行输入gcc -v会发现已经安装了gcc,请输入g++ -v,确认系统是否安装了g++ ,因为安装cmake需要同时安装gcc g++编译器。

安装g++命令如下 

==============================================================================

配置mysql安装环境:

cmake . -DCMAKE_INSTALL_PREFIX=/usr/local/mysql -DSYSCONFDIR=/etc -DDEFAULT_CHARSET=utf8 -DDEFAULT_COLLATION=utf8_general_ci -DWITH_EXTRA_CHARSETS=all

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

rm CMakeCache.txt

再执行环境配置

yum install gcc-c++ libstdc++-devel

安装g++之后再执行 ./configure 就不会出现了。