Search code examples
sphinx

Where to find mysql include files for configuring Sphinx on MAMP


I tried to configure using /.configure got the following error can anyone tell me how to resolve this?? I'm unable to find mysql files and include folder in MAMP/Library

any help..

configuring Sphinx
------------------

checking for CFLAGS needed for pthreads... none
checking for LIBS needed for pthreads... -lpthread
checking for pthreads... found
checking whether to compile with MySQL support... yes
checking for mysql_config... not found
checking MySQL include files... configure: error: missing include files.

******************************************************************************
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.
******************************************************************************

Many Thanks,


Solution

  • MAMP is missing some mysql's library and include files that sphinx requires. You have to upgrade your MAMP by coping the required files to the MAMP/Library/ directory.

    1. Go to your MAMP/Library directory and create mysql directory:
    2. Go to http://downloads.mysql.com/archives.php and download the appropriated one. You could go to phpMyAdmin to check your MAMP's mysql version.
    3. Untar it and copy the include/ and lib/ to the MAMP/Library/mysql you just created before.
    4. In terminal, assuming your MAMP is located in /Applications/, then your configure should be like below:

      $ ./configure --prefix=/usr/local/sphinx --with-mysql-includes=/Applications/MAMP/Library/mysql/include --with-mysql-libs=/Applications/MAMP/Library/mysql/lib

    I hope this helps. You can check out my blog on this problem or let me know if you meet any other problems.