编译后你会发现在mysql的根目录没有my.cnf配置文件,这时候系统会用自带/etc/my.cnf作为你的配置文件,这和你编译的配置文件路径不一样。建议把/etc/my.cnf改名为my.cng.back,然后用cp support-files/my-default.cnf ../my.cnf 将默认配置文件复制在你编译配置文件的路径。但是需要自己更改默认设置的配置文件。
[root@cloud mysql-5.7.15]# cmake . -LH
-- Running cmake version 2.8.11
-- Could NOT find Git (missing: GIT_EXECUTABLE)
-- Configuring with MAX_INDEXES = 64U
-- SIZEOF_VOIDP 8
-- MySQL 5.7.15
-- Packaging as: mysql-5.7.15-Linux-x86_64
-- Local boost dir /var/lib/boost_1_59_0
-- Local boost zip /var/lib/boost_1_59_0.tar.gz
-- Found /var/lib/boost_1_59_0/boost/version.hpp
-- BOOST_VERSION_NUMBER is #define BOOST_VERSION 105900
-- BOOST_INCLUDE_DIR /var/lib/boost_1_59_0
-- OPENSSL_INCLUDE_DIR = /usr/include
-- OPENSSL_LIBRARY = /usr/lib64/libssl.so
-- CRYPTO_LIBRARY = /usr/lib64/libcrypto.so
-- OPENSSL_MAJOR_VERSION = 1
-- SSL_LIBRARIES = /usr/lib64/libssl.so;/usr/lib64/libcrypto.so;dl
-- WITH_PROTOBUF=bundled
-- protobuf version is 2.6
-- Using cmake version 2.8.11
-- Disabling -Wunused-but-set-variable warning for building NDB
-- Disabling -Wstrict-aliasing warning for building NDB
-- Not building NDB
-- Using Boost headers from /var/lib/boost_1_59_0
-- MYSQLX - Text log of protobuf messages enabled
-- Library mysqlclient depends on OSLIBS -lpthread;/usr/lib64/libz.so;m;rt;/usr/lib64/libssl.so;/usr/lib64/libcrypto.so;dl
-- Library mysqlserver depends on OSLIBS -lpthread;/usr/lib64/libz.so;m;rt;/usr/lib64/libssl.so;/usr/lib64/libcrypto.so;dl;crypt
-- INSTALL mysqlclient.pc lib/pkgconfig
-- Skipping deb packaging on unsupported platform .
-- CMAKE_BUILD_TYPE: RelWithDebInfo
-- COMPILE_DEFINITIONS: _GNU_SOURCE;_FILE_OFFSET_BITS=64;HAVE_CONFIG_H;HAVE_LIBEVENT1
-- 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/src/mysql-5.7.15
-- Cache values
// Path to a file.
BOOST_INCLUDE_DIR:PATH=/var/lib/boost_1_59_0
// Bundle mecab and ipadic with plugin
BUNDLE_MECAB:BOOL=ON
// Choose the type of build, options are: None(CMAKE_CXX_FLAGS or
CMAKE_C_FLAGS used) Debug Release RelWithDebInfo MinSizeRel
CMAKE_BUILD_TYPE:STRING=RelWithDebInfo
// Install path prefix, prepended onto install directories.
CMAKE_INSTALL_PREFIX:PATH=/usr/local/mysql
// Set to true if this is a community build
COMMUNITY_BUILD:BOOL=ON
// Path to a library.
CRYPTO_LIBRARY:FILEPATH=/usr/lib64/libcrypto.so
//
DEB_CODENAME:STRING=
// Download boost from sourceforge.
DOWNLOAD_BOOST:BOOL=1
// Timeout in seconds when downloading boost.
DOWNLOAD_BOOST_TIMEOUT:STRING=600
// Enable profiling
ENABLED_PROFILING:BOOL=ON
// Enable debug sync (debug builds only)
ENABLE_DEBUG_SYNC:BOOL=ON
// Download and build 3rd party source code components, e.g. google mock
ENABLE_DOWNLOADS:BOOL=OFF
// Enable gcov (debug, Linux builds only)
ENABLE_GCOV:BOOL=OFF
// Enable gprof (optimized, Linux builds only)
ENABLE_GPROF:BOOL=OFF
// Enable SASL on InnoDB Memcached
ENABLE_MEMCACHED_SASL:BOOL=OFF
// Enable SASL on InnoDB Memcached
ENABLE_MEMCACHED_SASL_PWDB:BOOL=OFF
// Selection of features. This option is deprecated
FEATURE_SET:STRING=community
// Installation directory layout. Options are: TARGZ (as in tar.gz installer), WIN (as in zip installer), STANDALONE, RPM, DEB, SVR4, FREEBSD, GLIBC, OSX, SLES
INSTALL_LAYOUT:STRING=STANDALONE
// Where to install mysqlclient.pc, defaults to lib/pkgconfig
INSTALL_PKGCONFIGDIR:PATH=
// Path to a file.
LOCAL_BOOST_DIR:FILEPATH=/var/lib/boost_1_59_0
// Path to a file.
LOCAL_BOOST_ZIP:FILEPATH=/var/lib/boost_1_59_0.tar.gz
// Mutex type: event, sys or futex
MUTEXTYPE:STRING=event
// default MySQL data directory
MYSQL_DATADIR:PATH=/data/mysql
// default MySQL keyring directory
MYSQL_KEYRINGDIR:PATH=/usr/local/mysql/keyring
// MySQL maintainer-specific development environment
MYSQL_MAINTAINER_MODE:BOOL=OFF
// Path to a file.
OPENSSL_INCLUDE_DIR:PATH=/usr/include
// Path to a library.
OPENSSL_LIBRARY:FILEPATH=/usr/lib64/libssl.so
// Path to a file.
OPENSSL_ROOT_DIR:PATH=/usr
// Support tracing of Optimizer
OPTIMIZER_TRACE:BOOL=ON
// PATH to MySQL TMP dir. Defaults to the P_tmpdir macro in <stdio.h>
TMPDIR:PATH=P_tmpdir
// Link ARCHIVE statically to the server
WITH_ARCHIVE_STORAGE_ENGINE:BOOL=ON
// Enable address sanitizer
WITH_ASAN:BOOL=OFF
// Link BLACKHOLE statically to the server
WITH_BLACKHOLE_STORAGE_ENGINE:BOOL=ON
// Path to boost sources: a directory, or a tarball to be unzipped.
WITH_BOOST:PATH=/var/lib
// Support for client-side protocol tracing plugins
WITH_CLIENT_PROTOCOL_TRACING:BOOL=ON
// Use dbug/safemutex
WITH_DEBUG:BOOL=OFF
// Use flags from cmake/build_configurations/compiler_options.cmake
WITH_DEFAULT_COMPILER_OPTIONS:BOOL=ON
// Use feature set in cmake/build_configurations/feature_set.cmake
WITH_DEFAULT_FEATURE_SET:BOOL=ON
// By default use bundled editline
WITH_EDITLINE:STRING=bundled
// Compile MySQL with embedded server
WITH_EMBEDDED_SERVER:BOOL=ON
// Generate shared version of embedded library (in addition to the static one)
WITH_EMBEDDED_SHARED_LIBRARY:BOOL=OFF
// Options are: none, complex, all
WITH_EXTRA_CHARSETS:STRING=all
// Link FEDERATED statically to the server
WITH_FEDERATED_STORAGE_ENGINE:BOOL=ON
// Enable extra InnoDB debug checks
WITH_INNODB_EXTRA_DEBUG:BOOL=OFF
//
WITH_INNODB_MEMCACHED:BOOL=OFF
// By default use bundled libevent on this platform
WITH_LIBEVENT:STRING=bundled
// Compile with tcp wrappers support
WITH_LIBWRAP:BOOL=0
// By default use bundled lz4 library
WITH_LZ4:STRING=bundled
// <empty> (disabled) | system (use os library) | </path/to/custom/installation> (use custom version)
WITH_MECAB:STRING=
// Enable memory sanitizer
WITH_MSAN:BOOL=OFF
// Link NGRAM_PARSER statically to the server
WITH_NGRAM_PARSER:BOOL=ON
// Explicitly set NUMA memory allocation policy
WITH_NUMA:BOOL=ON
// Link PARTITION statically to the server
WITH_PARTITION_STORAGE_ENGINE:BOOL=ON
// Generate PIC objects
WITH_PIC:BOOL=OFF
// Build additonal code(plugins) that is located in rapid directory
WITH_RAPID:BOOL=ON
//
WITH_SSL:STRING=system
// Enable installation of systemd support files
WITH_SYSTEMD:BOOL=OFF
// Have a built-in test protocol trace plugin in libmysql (requires WITH_CLIENT_PROTOCOL_TRACING option)
WITH_TEST_TRACE_PLUGIN:BOOL=OFF
// Enable undefined behavior sanitizer
WITH_UBSAN:BOOL=OFF
// Compile MySQL with unit tests
WITH_UNIT_TESTS:BOOL=ON
// Valgrind instrumentation
WITH_VALGRIND:BOOL=OFF
//
WITH_ZLIB:STRING=system
// Enable logging of protobuf messages
XPLUGIN_LOG_PROTOBUF:STRING=1