Installing Sphinx with MySQL 5.7 - mysql

I am trying to install the Sphinx with MySQL 5.7 I have downloaded the tarball from Sphinx site whenever I am runnig this command sudo ./configure --prefix=/usr/local/sphinx --with-mysql I am getting this error.
configuring Sphinx
------------------
checking whether to use dynamic linking for DB drivers... no
checking for CFLAGS needed for pthreads... -pthread
checking for LIBS needed for pthreads... -lpthread
checking for pthreads... found
checking for pthread_mutex_timedlock... yes
checking whether to compile with MySQL support... dynamic
checking for mysql_config... mysql_config
checking for mysql_real_connect... no
checking for mysql_real_connect... no
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.
******************************************************************************
I have tried with installing this `sudo apt-get install libmysqlclient-dev' still it doesn't I have even tried with supplying the MySQL include files path still it doesn't work. can anyone what causing this error ? I am using ubuntu 12.04.

Installing mysql-devel helped me for centos sudo yum install mysql-devel.
Suppose that for ubuntu package name is same.

Related

what's the meaning of such mysql rpms

rpm -qa on my host,i see:
mysql-5.1.73-3.el6_5.x86_64
mysql-libs-5.1.73-3.el6_5.x86_64
but i still cant see mysql.h and mysql.so in the lib and include dir.so i google and see other two rpm:
mysql-server-5.1.73-3.el6_5.x86_64
mysql-devel-5.1.73-3.el6_5.x86_64
mysql-client-5.1.73-3.el6_5.x86_64
so
1)what's the meaning of these rpms?to me,mysql-libs-5.1.73-3.el6_5.x86_64 should have the *.so an *.a files installed,but i cant see them on the host?
"yum list installed mysql*" says nothing installed,but "rpm -qa" can see msyql rpms?what the diff of these two cmds?
mysql is the command line client
mysql-client is the same thing for Mandriva
mysql-libs are the shared libraries required for MySQL clients
mysql-server is the MySQL server
mysql-devel are the header files required to develop (compile) MySQL applications

Can we install MySQL different versions on Linux CentOS5.8?

I am trying to install a software which required MySQL-server, MySQL-client installed on the server so now I want to install MySQL-server and MySQL-client using rpm files "MySQL-server-5.5.17-1.rhel5.x86_64.rpm" and "MySQL-client-5.5.17-1.rhel5.x86_64.rpm".
I have installed MySQL-client but when I try to run mysql-server
*rpm -i MySQL-server-5.5.17-1.rhel5.x86_64.rpm*
it's showing error:
*error: Failed dependencies:
MySQL conflict with mysql-5.0.77-4.el5_6.6.x86_64
MySQL conflict with mysql-5.0.77-4.el5_6.6.i386
MySQL conflict with mysql-server-5.0.77-4.el5_6.6.x86_64*
So how can i solve this problem?
the error given by you *error: Failed dependencies:
MySQL conflict with mysql-5.0.77-4.el5_6.6.x86_64
MySQL conflict with mysql-5.0.77-4.el5_6.6.i386
MySQL conflict with mysql-server-5.0.77-4.el5_6.6.x86_64*
It clear show that the machine you are going to install mysql 5.5 rpm have mysql 5.0.77 installed .
to resolve this problem .
1. you take backup of datadir and my.cnf (if you are using mysql 5.0 db server earlier).
2. remove all mysql 5.0 server packages , to remove these package you should knew what are the packages already installed on machine
to view all mysql package already installed use rpm -qa | grep -i "mysql*" this command show what package is already installed on machine
now you have to remove all package which name shows in above command.
to remove a package/rpm use rpm -e mysql-5.0.** if show error then use
rpm -e --nodeps mysql-5.0.**
we have to remove all packages one by one by using rpm -e .
after successful remove all older version of mysql , now start installation of mysql-5.5*** packages by using rpm -ivh mysql-5.5***.rpm.
First question - is the version of MySQL already installed actually in use or was it simply there as a result of a fresh CentOS install? If the former, try upgrading rather than installing. If the latter, uninstall the old version (possibly using the --no-deps option on rpm) and then install the newer version
Next, are you trying to replace MySQL or install another version alongside it?
If the former, again try upgrading rather than installing. If that's not possible, you're going to have to remove the older version and then install the new version
If the latter, and if it is possible, look at the --prefix and --relocate options in RPM.as they may help.
If you do to mange to get it installed side by side with an older, you'll have fun and games ensuring that the relevant versions are pointing to the correct libraries and that you don't get any corruption between them. Also, you will need to run them so that they listen on separate ports with separate database folders, PID and socket files etc.
Whatever you need to do, do it out of business hours with as many backups as you can do

Sphinx 2.0.4 Install Error with MAMP 2.0: Can't Find MySQL Headers

Developing locally in MAMP and need Sphinx to work with MAMP's MySQL. Basically hitting a dead end during $ sudo make.
MAMP installs without some necessary resources for Sphinx integration, mainly a mysql lib directory and an include directory filled with C header source files. These were downloaded and installed successfully (using CMake) into the following directories:
/Applications/MAMP/Library/include/mysql
/Applications/MAMP/Library/lib/mysql
After unzipping Sphinx and running:
sudo ./configure --prefix=/usr/local/sphinx --with-libstemmer --with-mysql=/Applications/MAMP/Library
I got:
******************************************************************************
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
Changing the ./configure command to:
sudo ./configure --prefix=/usr/local/sphinx--with-libstemmer --with-mysql-includes /Applications/MAMP/Library/include --with-mysql-libs /Applications/MAMP/Library/lib
throws the following on the outset, but regardless results in a successful configuration:
configure: WARNING: you should use --build, --host, --target
configure: WARNING: invalid host type: /Applications/MAMP/Library/include
configure: WARNING: you should use --build, --host, --target
configure: WARNING: invalid host type: /Applications/MAMP/Library/lib
The log also has the following line, (which I think is relevant in a sec):
checking MySQL include files... -Iyes
Now, continuing, $ sudo make throws the following:
Making all in src
/bin/sh svnxrev.sh ..
make all-am
g++ -DHAVE_CONFIG_H -I. -I../config -DSYSCONFDIR="\"/usr/local/sphinx--with-libstemmer/etc\"" -DDATADIR="\"/usr/local/sphinx--with-libstemmer/var/data\"" -I/usr/local/include -Iyes -Wall -g -D_FILE_OFFSET_BITS=64 -O3 -DNDEBUG -MT sphinx.o -MD -MP -MF .deps/sphinx.Tpo -c -o sphinx.o sphinx.cpp
In file included from sphinx.cpp:16:
sphinx.h:64:19: error: mysql.h: No such file or directory
... //whole bunch of errors follow, resulting from the above
So, I know mysql.h exists in my includes file, I think I have all necessary binaries as well, and the configuration seems to see the include files so I'm tearing out my hair a bit. I'm hoping this is a simple path problem, or a syntax error on my part with the ./configure attribute since this is my first time compiling and installing from the command line.
Thanks.
Sphinx's ./configure uses an unknown default value for --with-mysql, which is enabled by default, which could make you think calling it is not necessary.
To get Sphinx to work with MAMP's varyingly distributed MySQL files, make sure to use each of the following attributes in your ./configure command, specifying direct paths for each:
--with-mysql= // root mysql app
--with-includes= // path to mysql header includes
--with-mysql-libs= // path to libmysqlclient.dylib files
The final command that worked for me:
./configure --prefix=/usr/local/sphinx --with-libstemmer --with-mysql=/Applications/MAMP/Library --with-mysql-includes=/Applications/MAMP/Library/include/mysql --with-mysql-libs=/Applications/MAMP/Library/lib/mysql
--prefix is your preferred install directory in usr/local and --libstemmer adds Snowball's extended stemming functionality (if you downloaded it).
If this runs without error, just make and make install and you're good to go.
Also note that there's a configure error log in the uncompressed Sphinx directory that's easy to overlook. Didn't help in this scenario, but could be really useful to others if you're having problems.

ruby on rails + xampp + mysql (windows 7)

I am trying to use the mysql package included in xampp with ruby on rails on windows 7, but cannot seem to get them to work together.
I have rails 3.0.0 and xampp 1.7.3
rails works with sqlite within xampp just fine, but when attempting to use mysql via "rails new project -d mysql; cd project; bundle install"
I get the following:
Installing mysql2 (0.2.4) with native extensions C:/xampp/Ruby192/lib/ruby/1.9.1
/rubygems/installer.rb:483:in `rescue in block in build_extensions': ERROR: Fail
ed to build gem native extension. (Gem::Installer::ExtensionBuildError)
C:/xampp/Ruby192/bin/ruby.exe extconf.rb
checking for rb_thread_blocking_region()... *** extconf.rb failed ***
Could not create Makefile due to some reason, probably lack of
necessary libraries and/or headers. Check the mkmf.log file for more
details. You may need configuration options.
Am I missing anything? All the posts about this issue tell me to use gem install mysql -- --with-mysql-config=PATH, but this does not seem to work with Windows, as I get the same error regardless.
And if it's just not possible, are there any drawbacks to using sqlite now, then trying to migrate the databse over to mysql (or another more robust database) later?
Did you install the mysql gem?
gem install mysql
After this you need to go to the mysql\bin directory in your XAMPP folder and copy the
libmysql.dll
into your ruby\bin folder.
Give it a try and let me know if it works. Also if your MySql version is 5.1 you may need to download a 5.0 version of the same dll.
gem install mysql --no-rdoc --no-ri -- '--with-mysql-lib="D:\xampp\mysql\lib" --with-mysql-include="D:\xampp\mysql\include"'
I used this code for my solution of mysql this is the right way you can USE mysql for xampp.
I once had a similar issue. The important things i noted was that i already have mysql installed for usage via xampp. Firstly, you should make sure that the mysql installation is accessible from cmd by typing
mysql --version
If it gives you a reply of our installation then you're good to go to the next step else copy the mysql bin directory and save it in your user environment variable called PATH. This should allow you to run the cmd code above fruitfully.
Next Step: run (on cmd)
gem install mysql2 --no-rdoc --no-ri
This worked for me.

Macports compile of MySQL++ failing

Before running "sudo port install mysqlxx +universal", I installed the universal variant of mysql5.
...
checking whether -lm is needed to use C math functions... no
checking whether -lsocket is needed... no
checking whether -lnsl is needed... no
checking for MySQL library directory... /opt/local/lib/mysql5/mysql
checking for MySQL include directory... /opt/local/include/mysql5/mysql
checking if we can link to MySQL C API library directly... no
checking zlib.h usability... yes
checking zlib.h presence... yes
checking for zlib.h... yes
checking for gzread in -lz... yes
checking whether adding -lz will let MySQL C API link succeed... no
configure: error: Unable to link to MySQL client library!
I suspect what's going on here is that you're running Snow Leopard. In previous versions of OS X, the default C++ compiler built 32-bit executables by default, but this changed to 64-bit in Snow Leopard. This can cause link problems with the MySQL C API library if it's not built as a Universal library supporting both 64- and 32-bit executables.
There are a bunch of ways around this problem, but most of the ones I know about either won't work with MacPorts or I don't know how to make them work. I've added a section on this to the MySQL++ README for Mac OS X, which you can read online, here.
Perhaps you can figure out how to adapt these solutions to the MacPorts build system. Something like this might work:
CFLAGS=-m32 CXXFLAGS=-m32 LDFLAGS=-m32 sudo port install mysqlxx +universal
That depends on those environment variables making it through the sudo and port barriers. You might have to get trickier. For instance:
sudo -s
CFLAGS=-m32 CXXFLAGS=-m32 LDFLAGS=-m32 port install mysqlxx +universal
As I commented above, it might be simplest to just build from the source tarball.