mysql5.6.27安装_mysql-5.6.27源码安装及错误解决办法

环境:centos6.5.x86_64yum install -y cmake  当然也可以自己下载源码包安装,为方便就Yum安装了

useradd -s /sbin/nologin mysql

tar zxvf mysql-5.6.27.tar.gz

mkdir -p /data/mysql

chown -R mysql:mysql /data/mysql

cd mysql-5.6.27

cmake . -DCMAKE_INSTALL_PREFIX=/usr/local/mysql -DMYSQL_DATADIR=/mysql/data -DDEFAULT_CHARSET=utf8  -DDEFAULT_COLLATION=utf8_general_ci -DWITH_EXTRA_CHARSETS:STRING=all -DWITH_DEBUG=0  -DENABLED_LOCAL_INFILE=1-- Running cmake version 2.8.12.2

-- Could NOT find Git (missing:  GIT_EXECUTABLE)

-- The C compiler identification is unknown

-- The CXX compiler identification is unknown

CMake Error: your C compiler: "CMAKE_C_COMPILER-NOTFOUND" was not found.   Please set CMAKE_C_COMPILER to a valid compiler path or name.

CMake Error: your CXX compiler: "CMAKE_CXX_COMPILER-NOTFOUND" was not found.   Please set CMAKE_CXX_COMPILER to a valid compiler path or name.

CMake Error at cmake/os/Linux.cmake:27 (STRING):

string sub-command REPLACE requires at least four arguments.

Call Stack (most recent call first):

CMakeLists.txt:149 (INCLUDE)

CMake Error at cmake/os/Linux.cmake:27 (STRING):

string sub-command REPLACE requires at least four arguments.

Call Stack (most recent call first):

CMakeLists.txt:149 (INCLUDE)

-- MySQL 5.6.27

-- Packaging as: mysql-5.6.27-Linux-i686

-- Could NOT find Threads (missing:  Threads_FOUND)

-- Could NOT find Threads (missing:  Threads_FOUND)

-- Check if the system is big endian

-- Searching 16 bit integer

CMake Error at /usr/share/cmake/Modules/TestBigEndian.cmake:44 (message):

no suitable type found

Call Stack (most recent call first):

configure.cmake:628 (TEST_BIG_ENDIAN)

CMakeLists.txt:398 (INCLUDE)

-- Configuring incomplete, errors occurred!

See also "/usr/local/src/mysql-5.6.27/CMakeFiles/CMakeOutput.log".

See also "/usr/local/src/mysql-5.6.27/CMakeFiles/CMakeError.log".

分析:

-- Could NOT find Git (missing:  GIT_EXECUTABLE)这项应该缺少git包,yum install -y git

-- The C compiler identification is unknown

-- The CXX compiler identification is unknown 这两项缺少gcc和gcc-c++的包,yum install -y gcc gcc-c++

另外需要rm CMakeCache.txt

继续cmake . -DCMAKE_INSTALL_PREFIX=/usr/local/mysql -DMYSQL_DATADIR=/mysql/data -DDEFAULT_CHARSET=utf8  -DDEFAULT_COLLATION=utf8_general_ci -DWITH_EXTRA_CHARSETS:STRING=all -DWITH_DEBUG=0 -DWITH_SSL=yes -DWITH_READLINE=1 -DENABLED_LOCAL_INFILE=1

出现错误:CMake Error: The following variables are used in this project, but they are set to NOTFOUND.

Please set them or make sure they are set and tested correctly in the CMake files:

OPENSSL_INCLUDE_DIR

used as include directory in directory /usr/local/src/mysql-5.6.27/CMakeFiles/CMakeTmp

CMake Error: Internal CMake error, TryCompile configure of cmake failed

-- Check size of wchar_t - failed

-- Check size of wctype_t

CMake Error: The following variables are used in this project, but they are set to NOTFOUND.

Please set them or make sure they are set and tested correctly in the CMake files:

OPENSSL_INCLUDE_DIR

used as include directory in directory /usr/local/src/mysql-5.6.27/CMakeFiles/CMakeTmp

CMake Error: Internal CMake error, TryCompile configure of cmake failed

-- Check size of wctype_t - failed

-- Check size of wint_t

CMake Error: The following variables are used in this project, but they are set to NOTFOUND.

Please set them or make sure they are set and tested correctly in the CMake files:

OPENSSL_INCLUDE_DIR

used as include directory in directory /usr/local/src/mysql-5.6.27/CMakeFiles/CMakeTmp

CMake Error: Internal CMake error, TryCompile configure of cmake failed

-- Check size of wint_t - failed

-- Could NOT find Curses (missing:  CURSES_LIBRARY CURSES_INCLUDE_PATH)

CMake Error at 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):

cmake/readline.cmake:128 (FIND_CURSES)

cmake/readline.cmake:202 (MYSQL_USE_BUNDLED_EDITLINE)

CMakeLists.txt:409 (MYSQL_CHECK_EDITLINE)

-- Configuring incomplete, errors occurred!

See also "/usr/local/src/mysql-5.6.27/CMakeFiles/CMakeOutput.log".

See also "/usr/local/src/mysql-5.6.27/CMakeFiles/CMakeError.log".

分析:-- Could NOT find Curses (missing:  CURSES_LIBRARY CURSES_INCLUDE_PATH)

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

rm CMakeCache.txt

重新cmake -DCMAKE_INSTALL_PREFIX=/usr/local/mysql -DMYSQL_DATADIR=/data/mysql -DDEFAULT_CHARSET=utf8  -DDEFAULT_COLLATION=utf8_general_ci -DWITH_EXTRA_CHARSETS:STRING=all -DWITH_DEBUG=0  -DENABLED_LOCAL_INFILE=1

出现warning:-- Running cmake version 2.8.12.2

-- MySQL 5.6.27

-- Packaging as: mysql-5.6.27-Linux-x86_64

-- HAVE_VISIBILITY_HIDDEN

-- HAVE_VISIBILITY_HIDDEN

-- HAVE_VISIBILITY_HIDDEN

-- Using cmake version 2.8.12.2

-- Not building NDB

-- Library mysqlclient depends on OSLIBS -lpthread;m;rt;dl

Warning: Bison executable not found in PATH

-- Library mysqlserver depends on OSLIBS -lpthread;m;rt;crypt;dl

-- CMAKE_BUILD_TYPE: RelWithDebInfo

-- COMPILE_DEFINITIONS: HAVE_CONFIG_H

-- 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/local/src/mysql-5.6.27

分析:Warning: Bison executable not found in PATH  缺少Bison,yum install -y bisoncmake -DCMAKE_INSTALL_PREFIX=/usr/local/mysql -DMYSQL_DATADIR=/data/mysql -DDEFAULT_CHARSET=utf8  -DDEFAULT_COLLATION=utf8_general_ci -DWITH_EXTRA_CHARSETS:STRING=all -DWITH_DEBUG=0  -DENABLED_LOCAL_INFILE=1

echo $? 是0代表OK

9.make && make install

10.chown -R mysql:mysql /usr/local/mysql/

11.cd /usr/local/mysql/

12. ./scripts/mysql_install_db --user=mysql --datadir=/data/mysql 初始化

13. cp support-files/my-default.cnf /etc/my.cnf

14. cp support-files/mysql.server /etc/init.d/mysqld

15. chmod 755 /etc/init.d/mysqld

16.vim /etc/init.d/mysqld   修改datadir=/data/mysql

19.service mysqld start

成功启动Starting MySQL.. SUCCESS!

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
mysql-5.6.25.tar 包含两个文件: - mysql-5.6.25.tar.gz Generic Linux (Architecture Independent), Compressed TAR Archive MD5: 37664399c91021abe070faa700ecd0ed -install.txt: 安装方法 首先解压mysql-5.6.25.tar: $ tar xf mysql-5.6.25.tar ------------------ Mysql 源码安装操作: 1. 创建用户 # groupadd mysql # useradd -g -r mysql mysql 2. 解压缩tar包 # tar xf mysql-5.6.25.tar.gz # cd mysql-5.6.25 3. 编译安装 # cmake . -DCMAKE_INSTALL_PREFIX=/usr/local/mysql \ > -DDEFAULT_CHARSET=gbk \ > -DDEFAULT_COLLATION=gbk_chinese_ci \ > -DENABLED_LOCAL_INFILE=ON \ > -DWITH_INNOBASE_STORAGE_ENGINE=1 \ > -DWITH_FEDERATED_STORAGE_ENGINE=1 \ > -DWITH_BLACKHOLE_STORAGE_ENGINE=1 \ > -DMYSQL_UNIX_ADDR=/tmp/mysqld.sock \ > -DWITH_DEBUG=0 \ > -DMYSQL_TCP_PORT=3306 # make # make install 4. 配置以及初始化MySQL # cd /usr/local/mysql 4.1 设置MySQL安装目录的权限 # chown -R mysql:mysql /usr/local/mysql 4.2 初始化MySQL # scripts/mysql_install_db --user=mysql # cp support-files/mysql.server /etc/init.d/mysqld 4.3 重新设置MySQL安装目录的权限(除data目录外,其余所有目录及文件均修改用户为root,组不变) # chown -R root . # chown -R mysql data 4.4 启动mysql_safe # bin/mysqld_safe --user=mysql & 4.5 设置MySQL的root帐号密码 - 自动设置:# ./bin/mysql_secure_installation 或 - 手动置:# ./bin/mysqladmin -u root password '' ------------------ 操作详情参看: https://github.com/Marslo/MyBlog/blob/master/Programming/MySQL/MySQLInstallationBySourceCode.md MySQL6源码安装官方手册: http://dev.mysql.com/doc/refman/5.6/en/installing-source-distribution.html ------------------ 资源为英文,下载请谨慎
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值