linux安装mysql出现Could NOT find Curses (missing CURSES_LIBRARY CURSES_INCLUDE_PATH),提示解决方法


进入mysql目录


[root@localhost software]# cd mysql-5.6.19

[root@localhost mysql-5.5.11]# cmake .

出现以下错误提示:

-- Could NOT find Curses (missing:  CURSES_LIBRARY CURSES_INCLUDE_PATH)
CMake Error at cmake/readline.cmake:82 (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:126 (FIND_CURSES)
  cmake/readline.cmake:216 (MYSQL_USE_BUNDLED_LIBEDIT)
  CMakeLists.txt:250 (MYSQL_CHECK_READLINE)


-- Configuring incomplete, errors occurred!

解决方法:

[root@localhost mysql-5.5.11]# rm CMakeCache.txt
[root@localhost mysql-5.5.11]# yum install ncurses-devel
Warning: Bison executable not found in PATH
-- Configuring done
-- Generating done
-- Build files have been written to: /software/mysql-5.5.11

[root@localhost mysql-5.5.11]# yum install bison

[root@localhost mysql-5.5.11]# make && make install

编译完成。


jiaoxiaogu2015-07-15上传
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 '
01-02 21:22