2014-04-17 24 views
0

我在使用percona 5.6在centos 6.4上安裝sphinx時出現問題。配置:錯誤:無效的MySQL根目錄

我收到以下錯誤,而從源文件編譯:

****************************************************************************** 
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 - 服務器 - 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: invalid MySQL root directory '/usr/lib64/mysql'; neither bin/mysql_config, nor include/ and lib/ were found there

這mysql_config

/usr/bin/mysql_config 

回答

0

你試過安裝MySQL-devel的?

sudo yum install mysql-devel 

如果正確設置,嘗試按照錯誤信息提示指向這些庫使用如下命令手工下面的一個(以適應你的環境)

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

你不能有mysql-devel和percona-devel在同一時間! – Orlo

+0

您可能是對的,但錯誤消息以「錯誤:無法找到MySQL包含文件」開頭。 所以你必須指向這種方式或其他方式。你有沒有試過--with-mysql-includes(使它指向個人庫並檢查出來) –