Wednesday, January 5, 2011

sphinx plugin compiling issue for mysql about _mysql_plugin_interface_version_

I know many people are getting following problem when loading sphinx plugin to mysql.

mysql> install plugin sphinx soname 'sphinx.so';
ERROR 1127 (HY000):
Can't find symbol '_mysql_plugin_interface_version_' in library

Looks like there are only two threads discussing this issue from google search and there is no proper solution for it. I happened to read one article:

Run Configure, you can use the ” –with-plugins=sphinx ” switch if you want sphinx built static into your mysql binary.

Is this problem caused by using --with-plugins=sphinx option when running ./configure? The answer is yes! Everything works well after removing --with-plugins=sphinx option from ./configure!!

My steps to build sphinx plugin:

#> cp -R SPHINX_SRC_PATH/mysqlse MYSQL_SRC_PATH/storage/sphinx

#> cd MYSQL_SRC_PATH

#> sh BUILD/autorun.sh

#> ./configure (no --with-plugins=sphinx option if you just want to build ha_sphinx.so)

#> cd storage/sphinx

#> make

#> echo "show variables like '%plugin%' | mysql
Variable_name   Value
plugin_dir      /usr/lib/mysql/plugin

#> copy ha_sphinx.so /usr/lib/mysql/plugin

#> copy sphinx.so /usr/lib/mysql/plugin

#> mysql
mysql> install plugin sphinx soname 'ha_sphinx.so';
mysql> show plugins;
+------------+----------+----------------+--------------+---------+
| Name       | Status   | Type           | Library      | License |
+------------+----------+----------------+--------------+---------+
...
| SPHINX     | ACTIVE   | STORAGE ENGINE | ha_sphinx.so | GPL     |
+------------+----------+----------------+--------------+---------+

Actually, no need to run the patch like sphinx-xxx-.diff and no need to build all mysql source. The build process is very simple.

2 comments:

  1. Just wanted to thank you for posting this. Came across it today and it solved my problem perfectly (and saved me a ton of hair-pulling I'm sure). Kudos!

    ReplyDelete