设置mydumper时,cmake无法找到mysql库

时间:2015-02-25 05:55:51

标签: mysql cmake

在我设置mydumper之前,我的服务器正在运行mysqld 5.6

我从

下载mydumper

https://launchpad.net/mydumper/0.6/0.6.2/+download/mydumper-0.6.2.tar.gz

我安装了mydumper所需的所有依赖项:

yum install cmake pcre-devel glib2-devel zlib-devel gcc gcc-c++ mysql-devel openssl-devel

当我运行cmake时。我看到一些错误:

-- Using mysql-config: /usr/bin/mysql_config
-- MySQL not found.

CMake Warning at docs/CMakeLists.txt:9 (message):
  Unable to find Sphinx documentation generator


-- ------------------------------------------------
-- MYSQL_CONFIG = /usr/bin/mysql_config
-- CMAKE_INSTALL_PREFIX = /usr/local
-- BUILD_DOCS = ON
-- WITH_BINLOG = OFF
-- RUN_CPPCHECK = OFF
-- Change a values with: cmake -D<Variable>=<Value>
-- ------------------------------------------------
-- 
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:
MYSQL_LIBRARIES_dl
    linked by target "mydumper" in directory /root/mydumper-0.6.2
    linked by target "myloader" in directory /root/mydumper-0.6.2
MYSQL_LIBRARIES_m
    linked by target "mydumper" in directory /root/mydumper-0.6.2
    linked by target "myloader" in directory /root/mydumper-0.6.2
MYSQL_LIBRARIES_mysqlclient
    linked by target "mydumper" in directory /root/mydumper-0.6.2
    linked by target "myloader" in directory /root/mydumper-0.6.2
MYSQL_LIBRARIES_pthread
    linked by target "mydumper" in directory /root/mydumper-0.6.2
    linked by target "myloader" in directory /root/mydumper-0.6.2
MYSQL_LIBRARIES_rt
    linked by target "mydumper" in directory /root/mydumper-0.6.2
    linked by target "myloader" in directory /root/mydumper-0.6.2

-- Configuring incomplete, errors occurred!
See also "/root/mydumper-0.6.2/CMakeFiles/CMakeOutput.log".
See also "/root/mydumper-0.6.2/CMakeFiles/CMakeError.log".

我还阅读了mydumper-0.6.2 / cmake / modules / FindMySQL.cmake然后进行了一些修改:

我在find_library函数中添加/ usr / lib64 / mysql但它没有用。

没有约束我必须使用mydumper。我只是没有好奇心,想尝试一下。

如何解决cmake的这个问题?

感谢您的时间!

1 个答案:

答案 0 :(得分:12)

尝试删除解压缩的mydumper目录,然后再次解压缩“mydumper-0.6.2.tar.gz”,然后查找它,你会发现它运行良好。

这是我的操作:

rm -rf mydumper-0.6.2
tar -zxvf mydumper-0.6.2.tar.gz
cd mydumper-0.6.2
cmake .
make
make install

祝你好运!