MySQL error: Can't find symbol '_mysql_plugin_interface_version_' in library - mysql

The boring, necessary details: I'm on Snow Leopard running MySQL locally.
I'm trying to install the Sphinx engine for MySQL like so:
mysql> install plugin sphinx soname 'sphinx.so';
ERROR 1127 (HY000): Can't find symbol '_mysql_plugin_interface_version_' in library
I've Googled everywhere and can't seem to find an actual solution to this problem. For example this issue on the Sphinx forums seems unresolved. Someone else also raised this issue with similar results.
The first post linked to this O'Reilly article which says:
There is a common problem that might occur at this point:
ERROR 1127 (HY000): Can't find symbol '_mysql_plugin_interface_version_' in library
If you see a message like this, it is likely that you forgot to include the -DMYSQL_DYNAMIC_PLUGIN option when compiling the plugin. Adding this option to the g++ compile line is required to create a dynamically loadable plug-in.
But the article ends on that point; I have no idea what this means or how to resolve the issue.

Configure mysql like this:
./configure --prefix=/usr/local/mysql
dont use:
./configure --prefix=/usr/local/mysql --with-plugins=sphinx
It forces the compiler to link the plugin statically.
Once done you should have a file called 'ha_sphinx.so'

I finally had to just recompile MySQL entirely rather than install it as a plugin. This involved a number of gotchas in and of itself, too. But save yourself the headache of trying to recreate the same compile conditions for Sphinx that you used for MySQL and just recompile all at once following the Sphinx documentation to the letter.

Related

"Fatal error: 'EXTERN.h' file not found" while installing Perl modules

While trying to install Perl modules like JSON::XS or YAML::XS, i receive the same error:
XS.xs:1:10: fatal error: 'EXTERN.h' file not found
I use MacBook, xCode is up to date, everything else that could help is up to date too.
Since OS X El Capitan, Apple introduced System Integrity Protection which restricts writing to /usr/lib /usr/bin and other sensitive directories (even to root or sudo user) that are used by the installation of Perl bundled with the Operating System. This can cause issues when it comes to installing new modules and also if trying to install XS modules ( those linked to external C libraries ).
For this reason you should not consider the default Perl installation as a working development environment, especially if you are installing custom modules.
Check out this thread on PM and others. I had since El-Capitan managed to solve this before by manually building from tarball and adding a few params or environment variables to set the paths believing that it would be best to retain use of the system Perl but this is not the way to go. This makes your environment difficult to build but also brittle and sensitive to OS updates that may either break things in many different ways.
The best practice seems to be starting with a Perl using brew install perl and work in this environment, remembering to setup your bash_profile as directed by the installer.
Also worth remembering to do a brew link perl. If you receive warnings about this clobbering what looks like system Perl libraries don't worry - these are likely modules that were installed by you over the top and it will cause you less trouble to link over these. If you have concerns, make a note of which module installs will be cleared and re-install them once your environment is configured ( ie your module installer approach is configured using cpanm or sticking with the old perl -MCPAN -e shell etc)
This new Perl setup from brew eliminates the need to continuing running sudo which adds another layer of things that can go wrong as environment variables don't follow through and permission conflicts arise etc.
Finally to simplify package/module installation I suggest doing a brew install cpanminus. If you had previously already installed this, you can ensure the paths etc are configured by doing a brew reinstall cpanminus
If you want to take it another step further then you can install perlbrew as well which will give you the ability to run multiple versions of Perl as your user and configure these with their own libs and modules which can be very useful particularly if aligning with your production environment for testing etc.
One problem you may face if moving from system Perl to this kind of approach is needing to deal with any hangovers from installing things with sudo. It wis worth taking a little time to get all this set up right though and your issues going forward will be greatly reduced and you won't be left with that nagging feeling that you don't want to change anything for fear of it all breaking.
I have also come across a Perl Blog Article that suggests a fix for XS issues with perlbrew on Mojave
This Gist described updating your cpan shell install root though this shouldn't be necessary unless your cpan is stuck in an old config after taking steps above.
I've also raised this as a new issue on PerlMonks
After reading https://developer.apple.com/documentation/xcode_release_notes/xcode_10_release_notes#3035624 and installing the Additional headers via
sudo installer -pkg /Library/Developer/CommandLineTools/Packages/macOS_SDK_headers_for_macOS_10.14.pkg -target /
I successfully compiled without the missing 'EXTERN.h' error
In order to follow the common advice I also tried with Perlbrew to install a dedicated development version of Perl. Especially with the advice in mind First, do not use the system Perl on MacOS. The installed version is for Apple, not for you (see the discussion here: https://www.perlmonks.org/?node_id=1224727).
Unfortunately, the following error occurred:
Test Summary Report
-------------------
porting/libperl.t (Wstat: 65280 Tests: 35 Failed: 0)
Non-zero exit status: 255
Parse errors: No plan found in TAP output
Files=2653, Tests=1217766, 708 wallclock secs (52.74 usr 9.40 sys + 395.38 cusr 49.90 csys = 507.42 CPU)
Result: FAIL
make: *** [test_harness] Error 1
##### Brew Failed #####
Therefore, I decided to install it the following way (and not following the advice due to the error).
Even after having the above mentioned macOS SDK headers already installed on Catalina (macOS 10.15.2) it didn't work for me. I faced the issue during the installation of the Perl module Mac-SystemDirectory-0.13. The following steps (by identifying the missing file in hope of having a more generic approach for more or less equivalent issues) did the trick:
Locate the header file (in this case EXTERN.h)
sudo find /Library -type f -name EXTERN.h
/Library/Developer/CommandLineTools/SDKs/MacOSX10.14.sdk/System/Library/Perl/5.18/darwin-thread-multi-2level/CORE/EXTERN.h
/Library/Developer/CommandLineTools/SDKs/MacOSX10.15.sdk/System/Library/Perl/5.28/darwin-thread-multi-2level/CORE/EXTERN.h
/Library/Developer/CommandLineTools/SDKs/MacOSX10.15.sdk/System/Library/Perl/5.18/darwin-thread-multi-2level/CORE/EXTERN.h
Ensure the installed Perl version (here 5.18) match the header file:
perl -v | grep version
This is perl 5, version 18, subversion 4 (v5.18.4) built for darwin-thread-multi-2level
Export the path for the C-Compiler (note MacOSX10.15.sdk for Catalina and Perl Version 5.18)
export CPATH=/Library/Developer/CommandLineTools/SDKs/MacOSX10.15.sdk/System/Library/Perl/5.18/darwin-thread-multi-2level/CORE
Invoke the Makefile.PL with perl
perl Makefile.PL
BTW — For anybody who's still struggling with this, my workaround was:
bash% module="Sub::Util" # For example
bash% cpanm --configure-args="INC=-I/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/System/Library/Perl/5.18/darwin-thread-multi-2level/CORE" "$module"
Please try this
CPATH=$(dirname $(find /usr/local/Cellar/ -name EXTERN.h)) cpan JSON::XS
For Big Sur and perl 5.30, EXTERN.h is at /Library/Developer/CommandLineTools/SDKs/MacOSX11.3.sdk/System/Library/Perl/5.30/darwin-thread-multi-2level/CORE
I'm trying to upgrade CPAN itself and got that error. But I have /usr/bin/cpan and I can't write there so I have to tweak it to write the updated version to /usr/local/bin/cpan.
No promises, but yum install perl-devel worked for me.
As #huyz has helpfully pointed out, if you hit this error on a Mac, you don't have this option, even though this is probably your issue, and you need to follow one of the above methods of getting a version of Perl that isn't missing important chunks, as per other answers.
But if, dear reader, you hit this error on a linux host, as I did, then this might be an option for you.
Building on what E Lisse suggested, you might also have luck looking in
/System/Volumes/Data/Library/Developer/CommandLineTools/SDKs/
For example:
CPATH=$(dirname $(find /System/Volumes/Data/Library/Developer/CommandLineTools/SDKs/ -name EXTERN.h)) cpan JSON::XS
You could also find where EXTERN.h is located and add that to your shell by default, e.g. in your .bashrc or .zshrc file:
export CPATH=/System/Volumes/Data/Library/Developer/CommandLineTools/SDKs/MacOSX12.sdk/System/Library/Perl/5.18/darwin-thread-multi-2level/CORE/

Compile MySQL 5.6.30 on CentOS 6.7 - "Manually-specified variables were not used"

I have downloaded the mysql-5.6.30.tar.gz source file, extracted and I'm using the following CMAKE command:
cmake /mysql-5.6.30 -DCMAKE_INSTALL_PREFIX=/usr/local/mysql -DWITH_CHARSET=CP1251=1
-DENABLE_THREAD_SAFE_CLIENT=1 -DMAX_INDEXES=250 -DDOWNLOAD_BOOST=1
-DWITH_BOOST=%HOME/mysqlboost -DENABLE_DOWNLOADS=1
Most of that is normal, apart from the MAX_INDEXES value of 250. The client has very specific requirements for this, and is the reason I am trying to compile this from source (there doesn't appear to be a way to change this value once MySQL is installed, must be done at compile).
CMake runs through the compilation (after i fixed various dependencies being missing and such), but at the end states:
-- Generating done
CMake Warning:
Manually-specified variables were not used by the project:
CMAKE_CC_COMPILER
DOWNLOAD_BOOST
ENABLE_THREAD_SAFE_CLIENT
MAX_INDEXES
WITH_BOOST
WITH_CHARSET
-- Build files have been written to: /mysql-5.6.30
This is a bit of an issue, as I specifically needed MAX_INDEXES to be written to the build files so I can install MySQL with it. Can anyone tell me A) Why is it ignoring every single variable I passed to it? and/or B) Is there any other way to enforce MAX_INDEXES (to at least 200) in a MySQL Installation. If it helps, it can be 5.6 or 5.7.
Thanks.
You can solve the MAX_INDEXES and ENABLE_THREAD_SAFE_CLIENT problem with this from the MySQL source directory (tested):
MY_FLAGS="DMAX_INDEXES=256 -DENABLE_THREAD_SAFE_CLIENT"
cmake -DCMAKE_C_FLAGS="$MY_FLAGS" -DCMAKE_CXX_FLAGS="$MY_FLAGS" .
The reason it ignored your variables was because they were not Cmake variables, but rather macros referenced by the source of MySQL (some).
The variables understood by Cmake are documented at https://dev.mysql.com/doc/refman/5.6/en/source-configuration-options.html
For the internal macros you have to search in the MySQL source.
According to mysql documentation on source configuration options, the configuration options you listed are eithes supported from a certain mysql v5.7 version or are not even listed on that page, meaning they are not mysql specific.
Compile a mysql v5.7.1 or higher from source to be able to set max_indexes config option.

MonoDevelop ValaBinding install failed

I installed monodevelop in ubuntu 13.04 from git with the help of README.md, but I received an error
checking for LIBVALA... no
configure: error: Package requirements (libvala-0.12 >= 0.12) were not met:
No package 'libvala-0.12' found
Consider adjusting the PKG_CONFIG_PATH environment variable if you
installed software in a non-standard prefix.
Alternatively, you may set the environment variables LIBVALA_CFLAGS
and LIBVALA_LIBS to avoid the need to call pkg-config.
See the pkg-config man page for more details.
I have installed libvala-0.20-0 and libvala-0.20-dev by apt-get.
I have googled for this question and found some links,but helpless.
my mono was at version 3.6.1.
THX FOR HELP.
update 2014-06-19
I found the config.log file and see the error
configure:4075: checking for LIBVALA
configure:4084: $PKG_CONFIG --exists --print-errors "libvala-0.12 >= $LIBVALA_REQUIRED_VERSION"
Package libvala-0.12 was not found in the pkg-config search path.
Perhaps you should add the directory containing `libvala-0.12.pc'
to the PKG_CONFIG_PATH environment variable
Although I have installed libvala-0.20-0 and libvala-0.20-dev, I doesn't own a libvala-0.**.pc file.
What can I do the next?
I have resolved thest problem by finding a libvala-0.12.pc file :)
While the Vala language, valac, and most of the bindings distributed with Vala are meant to be API stable, libvala is not. libvala-0.20 provides a very different API/ABI from libvala-0.12, and apparently MonoDevelop's Vala plugin hasn't been updated since Vala 0.12.
If you don't want the Vala plugin, I'm sure MonoDevelop provides a way to disable it (probably passing --disable-vala or something similar to ./configure). If you need the Vala plugin, though, you'll have to install libvala-0.12 or update the plugin to use a newer version of libvala.
now the problem is solved.
I used cn.archive.ubuntu.com/ubuntu for my apt-get.
These's no libvala-**.pc file in the package.
So whatever version I installed by apt-get, I can not get a libvala-*.pc file.
I searched in google for libvala-12.0.pc and changed my source to cz.archive.ubuntu.com/ubuntu, then I got that file.
Now I can run my monodevelop with valabinding.
Thx for #nemequ , I didn't use a higher libvala, so I don't know if it will be different when using a libvala-hight-than-12.0.pc file.
Hope these is usefull for others.
If you don't want to install vavabind after configure once ,just use ./configure --select, it's written in README. My bad :(

What is the reason for the error message "Library not loaded: libmysqlclient.18.dylib"?

I have no experience working with Perl, and I'm trying to run the geo_to_mysql.pl program for a project I'm working on. I made no modifications to the program other than the database, username, password and file directory path in the first few lines.
When running the program, I keep getting this error:
install_driver(mysql) failed: Can't load '/Library/Perl/5.10.0/darwin-thread-multi-2level/auto/DBD/mysql/mysql.bundle' for module DBD::mysql: dlopen(/Library/Perl/5.10.0/darwin-thread-multi-2level/auto/DBD/mysql/mysql.bundle, 1): Library not loaded: libmysqlclient.18.dylib
Referenced from: /Library/Perl/5.10.0/darwin-thread-multi-2level/auto/DBD/mysql/mysql.bundle
Reason: image not found at /System/Library/Perl/5.10.0/darwin-thread-multi-2level/DynaLoader.pm line 207.
at (eval 7) line 3
Compilation failed in require at (eval 7) line 3.
Perhaps a required shared library or dll isn't installed where expected
I've made sure that I installed the DBD required for MySQL from CPAN, so I don't think that's the issue. Can anyone shed some light on this issue?
It sure sounds like you might want to read this blog post:
http://probably.co.uk/problems-installing-dbdmysql-on-os-x-snow-leopard.html
The issue seems to be that the mysqlclient dynamic library doesn't have path information in it. You need to manaully fix this (as the post above notes).
One of the cheaper solutions is to symlink or copy the libmysqlclient library to /usr/lib.
Hope this helps anyone looking for this question in the future.
The DBD::mysql module needs access to the MySQL client libraries in order to work. I'm surprised that DBD::mysql even installed without them being on your system. How did you install the DBD::mysql module?

Using MySQL in R for Windows

How to use MySQL in R (statistic language) for Windows (7)?
There is no problems then using linux:
install.packages('RMySQL')
library(RMySQL)
...
But I found no such package for Windows on CRAN. There is only note about this fact.
I found package for version 2.10, but it is not usable in 2.12.1.
Also tried
install.packages("RMySQL", type="source")
but got an error :
* installing *source* package 'RMySQL' ...
ERROR: configuration failed for package 'RMySQL'
* removing 'C:/.../R/win-library/2.12/RMySQL'
Is there any way to connect to MySQL database from R in windows?
Found solution with help of ran2, who gave me link to common question. The basic process is described here, but there are several hints, So I will describe the whole solution (please change the R version and paths if needed):
Install latest RTools from here
install MySQL or header and library files of mysql
create or edit file C:\Program Files\R\R-2.12.1\etc\Renviron.site and add line like MYSQL_HOME=C:/mysql (path to your mysql files)
copy libmysql.lib from mysql/lib to mysql/lib/opt to meet dependencies.
copy libmysql.dll to C:\Program Files\R\R-2.12.1\bin or to windows/system32 directory.
run install.packages('RMySQL',type='source') and wait while compilation will end.
Thanks to all who tried to answer.
possible duplicate. However, my suggestions is to try WAMP which comes as a one click install. Admittedly you get more than you need (webserver) but the MySQL installation runs pretty well.
You need to install the MySQL headers and libraries, as explained in the installation instructions. Please do read the documentation before turning to SO.