编译安装mysql5.6以上版本报错解决

心已入冬 提交于 2020-08-11 17:28:54


查看官网安装说明:

http://dev.mysql.com/doc/refman/5.6/en/binary-installation.html

一、编译安装

shell> groupadd mysql
shell> useradd -r -g mysql mysql
shell> cd /usr/local
shell> tar zxvf /path/to/mysql-VERSION-OS.tar.gz
shell> ln -s full-path-to-mysql-VERSION-OS mysql
shell> cd mysql
shell> chown -R mysql .
shell> chgrp -R mysql .
shell> scripts/mysql_install_db --user=mysql
shell> chown -R root .
shell> chown -R mysql data
shell> bin/mysqld_safe --user=mysql &# Next command is optional
shell> cp support-files/mysql.server /etc/init.d/mysql.server

二、cmake过程报错说明及解决:

1、curses报错:

-- Could NOT find OpenSSL (missing: OPENSSL_LIBRARIES OPENSSL_INCLUDE_DIR)  
-- Could NOT find Curses (missing: CURSES_LIBRARY CURSES_INCLUDE_PATH)  
CMake Error at cmake/readline.cmake:83 (MESSAGE):
Curses library not found. Please install appropriate package,

解决方法: yum install ncurses-devel


2、HAVE_PEERCRED报错:
































-- 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)

解决方法:yum install gcc gcc-c++ -y


3、bison报错:

-- Googlemock was not found. gtest-based unit tests will be disabled. You can run cmake . -DENABLE_DOWNLOADS=1 to automatically download and build required components from source.
-- If you are inside a firewall, you may need to use an http proxy: export http_proxy=http://example.com:80
Warning: Bison executable not found in PATH
-- Library mysqlserver depends on OSLIBS -lpthread;m;rt;crypt;dl


解决方法:yum install -y libaio bison

















之后清理缓存文件,然后重新编译:

rm -f CMakeCache.txt
cmake .

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!