1. 安装gcc
yuminstallgccgcc-c++ncurses-develperl
2. 下载源码包(一定要是source类型的,要不然从cmake就会出错)
3. 解压后进入MysqL目录
4.cmake编译配置(会出错误)
cmake . -DCMAKE_INSTALL_PREFIX=/usr/local/MysqL \
-DDEFAULT_CHARSET=utf8 \
-DDEFAULT_COLLATION=utf8_general_ci \
-DENABLED_LOCAL_INFILE=ON \
-DWITH_INNOBASE_STORAGE_ENGINE=1 \
-DWITH_FEDERATED_STORAGE_ENGINE=1 \
-DWITH_BLACKHOLE_STORAGE_ENGINE=1 \
-DWITHOUT_EXAMPLE_STORAGE_ENGINE=1 \
-DWITH_PARTITION_STORAGE_ENGINE=1 \
-DWITH_PERFSCHEMA_STORAGE_ENGINE=1 \
-DCOMPILATION_COMMENT='JSS for MysqLtest' \
-DWITH_READLINE=ON \
-DSYSCONFDIR=/data/MysqLdata/3306 \
-DMysqL_UNIX_ADDR=/data/MysqLdata/3306/MysqL.sock
5.出错
-- Could NOT find Curses (missing: CURSES_LIBRARY CURSES_INCLUDE_PATH)
CMake Error at @H_301_49@cmake/readline.cmake:85 (MESSAGE):
Curses library not found. Please install appropriate package,
remove CMakeCache.txt and rerun cmake.On Debian/Ubuntu,package name is libncurses5-dev,on RedHat and derivates it is ncurses-devel.
Call Stack (most recent call first):
@H_301_49@ cmake/readline.cmake:128 (FIND_CURSES)
cmake/readline.cmake:202 (MysqL_USE_BUNDLED_EDITLINE)
CMakeLists.txt:421 (MysqL_CHECK_EDITLINE)
-- Configuring incomplete,errors occurred!
See also "/soft/MysqL-5.6.30/CMakeFiles/CMakeOutput.log".
See also "/soft/MysqL-5.6.30/CMakeFiles/CMakeError.log".
yum install ncurses-devel
7.重新删除配置文件:
rm -rf CMakeCache.txt
8. 重新执行第4步
9. make && make install(如果出错,可能是因为没有权限,要分开用sudo执行)
*****************************************
启动MysqL
- cpsupport-files/MysqL.server/etc/init.d/MysqLd
- vim/etc/profile
- PATH=/usr/local/MysqL/bin:/usr/local/MysqL/lib:$PATH
- exportPATH
- source/etc/profile