0
votes

I'd like to install the following UDF's from sam J levy's site

I have run through the windows (32 bit) installation with wamp for my testing server with no problem. Now I have my proper server running centOs 6.4. I have copied the .so files to

usr/lib64/mysql/plugin/damlev.so

I then try to run one of the sql statements to create the function

CREATE FUNCTION damlev RETURNS INTEGER SONAME 'damlev.so';

And get the following error

1126 - Can't open shared library 'damlev.so' (errno: 22 /usr/lib64/mysql/plugin/damlev.so: wrong ELF class: ELFCLASS32)

What Am I doing wrong. Is it because the server is 64bit?

Edit Bounty Started:

If more details about the server are required I can gladly supply them. I need this function installed.

1
Have you tried the suggested resolutions here?Steve Chambers

1 Answers

1
votes

It seems that you're trying to use the damlev.so library included in the damlev.zip file of the Levi's site, but that library is for an Ubuntu 32-bit system, therefore it cannot work on your Centos 64-bit system, so you'll have to compile from sources.
As a prerequisite, you must install the g++ compiler and the mysql development libraries:

yum install gcc-c++ mysql-devel

Also, if you don't have wget and unzip, install them with the following command:

yum install wget unzip

Then download the source code and unzip it somewhere:

cd tmp
mkdir damlev
cd damlev
wget http://samjlevy.com/wp-content/uploads/2011/03/damlev.zip
unzip damlev.zip
cd src

Finally compile, install the plugin and restart the mysql server:

g++ -fPIC -I /usr/include/mysql/ -o damlev.so -shared damlev.cpp
cp damlev.so /usr/lib64/mysql/plugin/
service mysql restart

Please note that all the above command must be run as "root".