[root@server6 mysql-5.7.17]# cmake 编译-DCMAKE_INSTALL_PREFIX=/usr/local/lnmp/mysql -DMYSQL_DATADIR=/usr/local/lnmp/mysql/data -DMYSQL_UNIX_ADDR=/usr/local/lnmp/mysql/data/mysql.sock -DWITH_MYISAM_STORAGE_ENGINE=1 -DWITH_INNOBASE_STORAGE_ENGINE=1 -DDEFAULT_CHARSET=utf8 -DDEFAULT_COLLATION=utf8_general_ci -DEXTRA_CHARSETS=all
-- Running cmake version 2.8.12.2-- CouldNOT find Git (missing:GIT_EXECUTABLE)
-- Configuring with MAX_INDEXES = 64U
-- TheC compiler identification is GNU4.4.7-- TheCXX compiler identification is GNU4.4.7-- Checkfor working Ccompiler: /usr/bin/cc
-- Checkfor working Ccompiler: /usr/bin/cc -- works
-- DetectingC compiler ABI info
-- DetectingC compiler ABI info - done
-- Checkfor working CXXcompiler: /usr/bin/c++
-- Checkfor working CXXcompiler: /usr/bin/c++ -- works
-- DetectingCXX compiler ABI info
-- DetectingCXX compiler ABI info - done
-- LookingforSHM_HUGETLB-- LookingforSHM_HUGETLB - found
-- Lookingfor sys/types.h
-- Lookingfor sys/types.h - found
-- Lookingfor stdint.h
-- Lookingfor stdint.h - found
-- Lookingfor stddef.h
-- Lookingfor stddef.h - found
-- Check size of void *
-- Check size of void * - done
-- SIZEOF_VOIDP8-- PerformingTestHAVE_C_SHIFT_OR_OPTIMIZATION_BUG-- PerformingTestHAVE_C_SHIFT_OR_OPTIMIZATION_BUG - Failed-- PerformingTestHAVE_CXX_SHIFT_OR_OPTIMIZATION_BUG-- PerformingTestHAVE_CXX_SHIFT_OR_OPTIMIZATION_BUG - Failed-- PerformingTestHAVE_C_FLOATING_POINT_FUSED_MADD-- PerformingTestHAVE_C_FLOATING_POINT_FUSED_MADD - Failed-- PerformingTestHAVE_CXX_FLOATING_POINT_FUSED_MADD-- PerformingTestHAVE_CXX_FLOATING_POINT_FUSED_MADD - Failed-- PerformingTestHAVE_C_FP_CONTRACT_FLAG-- PerformingTestHAVE_C_FP_CONTRACT_FLAG - Failed-- PerformingTestHAVE_CXX_FP_CONTRACT_FLAG-- PerformingTestHAVE_CXX_FP_CONTRACT_FLAG - Failed-- MySQL5.7.17-- Packagingas: mysql-5.7.17-Linux-x86_64
-- Lookedfor boost/version.hpp inand-- BOOST_INCLUDE_DIRBOOST_INCLUDE_DIR-NOTFOUND-- LOCAL_BOOST_DIR-- LOCAL_BOOST_ZIP-- Couldnot find (the correct version of) boost.
-- MySQL currently requires boost_1_59_0
CMake Error at cmake/boost.cmake:81 (MESSAGE):
You can download it with -DDOWNLOAD_BOOST=1
-DWITH_BOOST=<directory>
提示的报错信息,加在编译后面即可
This CMake script will look for boost in <directory>. If it is not there,
it will download and unpack it (in that directory) for you.
If you are inside a firewall, you may need to use an http proxy:
export http_proxy=http://example.com:80
Call Stack (most recent call first):
cmake/boost.cmake:238 (COULD_NOT_FIND_BOOST)
CMakeLists.txt:455 (INCLUDE)
-- Configuring incomplete, errors occurred!
See also "/root/mysql-5.7.17/CMakeFiles/CMakeOutput.log".
See also "/root/mysql-5.7.17/CMakeFiles/CMakeError.log".
系统提示必须删除CMakeCache.txt,不然解决的依赖性不会被读取
remove CMakeCache.txtand 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:107 (FIND_CURSES)
cmake/readline.cmake:197 (MYSQL_USE_BUNDLED_EDITLINE)
CMakeLists.txt:483 (MYSQL_CHECK_EDITLINE)
-- Configuring incomplete, errors occurred!
See also "/root/mysql-5.7.17/CMakeFiles/CMakeOutput.log".
See also "/root/mysql-5.7.17/CMakeFiles/CMakeError.log".
[root@server6 mysql-5.7.17]# yum install ncurses-devel -y
安装提示的服务
[root@server6 mysql]# mysqld --initialize --user=mysql 初始化,这个是初始化密码
root@localhost:2=G7f5.ddIZ=
[root@server6 mysql]# ls
bin data include man README support-files
COPYING docs lib mysql-test share
[root@server6 mysql]# cd data/
[root@server6 data]# ls
auto.cnf ibdata1 ib_logfile1 performance_schema
ib_buffer_pool ib_logfile0 mysql sys
[root@server6 data]# /etc/init.d/mysqld start 可以开启服务StartingMySQL.Logging to '/usr/local/lnmp/mysql/data/server6.err'.
. SUCCESS!
[root@server6 data]# /etc/init.d/mysqld stop 可以停止服务Shutting down MySQL.. SUCCESS!
[root@server6 data]# chkconfig --list mysqld
service mysqld supports chkconfig, but is not referenced in any runlevel (run 'chkconfig --add mysqld')
[root@server6 mysql]# chown mysql data/ -R 仅仅更改data目录的用户为mysql
[root@server6 mysql]# ll
total 60
drwxr-xr-x 2 root mysql 4096Aug510:25 bin
-rw-r--r-- 1 root mysql 17987Nov282016COPYING
drwxr-x--- 5 mysql root 4096Aug511:19 data
drwxr-xr-x 2 root mysql 4096Aug510:25 docs
drwxr-xr-x 3 root mysql 4096Aug510:25in