1

I'm having issues installing lib_mysqludf_sys on RHEL 6.5

MySQL Version - 5.6.23

Getting Below Error :

Compiling the MySQL UDF

gcc -Wall -I/usr/include/mysql -I. -shared lib_mysqludf_sys.c -o /usr/lib/lib_mysqludf_sys.so
/usr/bin/ld: /tmp/cclkfAbr.o: relocation R_X86_64_32 against `.rodata' can not be used when making a shared object; recompile with -fPIC
/tmp/cclkfAbr.o: could not read symbols: Bad value
collect2: ld returned 1 exit status
make: *** [install] Error 1
ERROR: You need libmysqlclient development software installed
to be able to compile this UDF, on Debian/Ubuntu just run:
apt-get install libmysqlclient15-dev

please let me know if any other way install the lib_mysqludf_sys on RedHat 6.5

Mukesh
  • 7,630
  • 21
  • 105
  • 159
sudhakaranR87
  • 210
  • 4
  • 14

1 Answers1

0

This an old question, but posting for folks still trying to figure this out. For RedHat/CentOS 6.10 to create lib_mysqludp_sys.so (https://github.com/mysqludf/lib_mysqludf_sys/) use the following Makefile (OP is missing the -fPIC in Makefile):

   LIBDIR=/usr/lib64/mysql/plugin

   install:
           gcc -Wall -I/usr/include/mysql -I. -shared lib_mysqludf_sys.c -fPIC -o 
   $(LIBDIR)/lib_mysqludf_sys.so

   # above line is on one line

Running version 5.5 of MySQL on RedHat 6.10 with following installed: mysql55w, libmysqlclient16, mysql55w-devel, mysql55w-libs, and mysql55w-server