Reputation: 21
I want to insert into MYSQL UDF function "http_get".
Currently I have a "mysql-udf-http.so" file that I import the function in the program, but to run it I get the error message:
ERROR 2013 (HY000): Lost connection to MySQL server During query
In this link: "http://code.google.com/p/mysql-udf-http/issues/detail?id=3" appears just a post with a fix for this problem. Now I'm trying to create from this new file "mysql-udf-http.c" a new file "mysql-udf-http.so"
My header data are:
# include <string.h>
# include <stdlib.h>
# include <stdio.h>
# include </usr/include/mysql/mysql.h>
# include </home/admin/mysql-udf-http-1.0/curl-7.21.1/include/curl/curl.h>
# include "mysql-udf-http.h"
I make a compilation with the command "g++ -fPIC -I /usr/include/mysql/ -o mysql-udf-http.so -shared mysql-udf-http.c" Showing no error message when compiling, but when I import the function in MYSQL, returns error message:
ERROR 1126 (HY000): Can not open shared library 'mysql-udf-http.so' (errno: 22 / usr / lib64 / mysql / plugin / mysql-udf-http.so: undefined symbol: curl_easy_setopt)
In this other link: "How do I link libcurl to my c++ program in linux?" appears a review of how to do the compilation properly. I have no "libcurl.a" file, only one directory with libcurl other content file.
I enter the command to compile: g++ -fPIC -I /usr/include/mysql/ -o mysql-udf-http.so -shared mysql-udf-http.c -L/home/admin/mysql-udf-http-1.0/curl-7.21.1/docs/libcurl/ -lcurl
No compilation error messages.
But finally when importing into MYSQL error message:
ERROR 1127 (HY000): Can not find symbol 'http_get' in library'
Someone can correct mistakes or help me to do the "mysql-udf-http.so" valid for centOS 64bit?
Upvotes: 2
Views: 2055