configure:error:MySQL根目录无效

时间:2014-04-17 04:36:33

标签: mysql centos percona

我在使用percona 5.6安装sphinx时遇到问题6.4。

从源代码构建时出现以下错误:

******************************************************************************
ERROR: cannot find MySQL include files.

Check that you do have MySQL include files installed.
The package name is typically 'mysql-devel'.

If include files are installed on your system, but you are still getting
this message, you should do one of the following:

1) either specify includes location explicitly, using --with-mysql-includes;
2) or specify MySQL installation root location explicitly, using --with-mysql;
3) or make sure that the path to 'mysql_config' program is listed in
   your PATH environment variable.

To disable MySQL support, use --without-mysql option.
******************************************************************************

安装了Percona-Server-devel:

rpm -qa | grep -i percona
percona-release-0.0-1.x86_64
Percona-Server-server-56-5.6.16-rel64.2.el6.x86_64
Percona-Server-client-56-5.6.16-rel64.2.el6.x86_64
Percona-Server-devel-56-5.6.16-rel64.2.el6.x86_64
Percona-Server-shared-56-5.6.16-rel64.2.el6.x86_64

我尝试了什么:

locate "libmysql"

    /usr/lib64/libmysqlclient.so.18
    /usr/lib64/libmysqlclient.so.18.0.0
    /usr/lib64/libmysqlclient_r.so.18
    /usr/lib64/libmysqlclient_r.so.18.0.0
    /usr/lib64/mysql/libmysqlclient.so.16
    /usr/lib64/mysql/libmysqlclient.so.16.0.0
    /usr/lib64/mysql/libmysqlclient_r.so.16
    /usr/lib64/mysql/libmysqlclient_r.so.16.0.0
    /usr/lib64/mysql/libmysqlservices.a

比:

  ./configure --with-mysql=/usr/lib64/mysql --with-mysql-libs=/usr/lib64/mysql
  ./configure --with-mysql=/usr/lib64 --with-mysql-libs=/usr/lib64
  ./configure --with-mysql=/usr/bin/mysql --with-mysql-libs=/usr/bin/mysql
  ./configure --with-mysql=/usr
  

configure:error:MySQL根目录无效'/ usr / lib64 / mysql';   既没有bin / mysql_config,也没有在那里找到/和lib /

mysql_config

/usr/bin/mysql_config

1 个答案:

答案 0 :(得分:0)

您是否尝试过安装mysql-devel?

sudo yum install mysql-devel

如果设置正确,请按照错误消息中的建议尝试使用如下命令手动指向这些库(以适应您的环境)

./configure --with-mysql-includes=/usr/local/src/mysql-XXX/include