because the project needs, the database table updates to the real-time push the message to the user, think of using mysql-udf-http plugin to give MySQL provide http request.
To start the installation:
Install according to the http://zyan.cc/mysql-udf-http/2/1/method,
Execute to
./configure--prefix=/usr/local/webserver/mysql--with-mysql=/usr/local/webserver/mysql/bin/mysql_config
When found that the MySQL is not a unified directory (the current MySQL is the way to install the RPM), the directory is chaotic, installation is unsuccessful. Well, reinstall a compiled installation of MySQL.
compile-mode installation MySQL :
Follow the http://www.cnblogs.com/xiongpq/p/3384681.html method to install.
The MySQL installation path is
/usr/local/mysql
Continue installation mysql-udf-http
tar zxvf curl-7.21.1.tar.gz
cd curl-7.21.1/ ./configure --prefix=/usr
To perform this step, error:
No package ‘libcurl‘ 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 DEPS_CFLAGS
and DEPS_LIBS to avoid the need to call pkg-config.
See the pkg-config man page for more details.
Find a solution online:
[[email protected] mysql-udf-http-1.0]# whereis pkgconfig
pkgconfig: /usr/lib/pkgconfig /usr/lib64/pkgconfig /usr/local/lib/pkgconfig /usr/share/pkgconfig
[[email protected] mysql-udf-http-1.0]# export > PKG_CONFIG_PATH=/usr/local/lib/pkgconfig:/usr/lib/pkgconfig
Continue installation
tar zxvf mysql-udf-http-1.0.tar.gz
cd mysql-udf-http-1.0/ ./configure --prefix=/usr/local/webserver/mysql --with-mysql=/usr/local/webserver/mysql/bin/mysql_config
make && make install
To get here when you want to know if the installation succeeds, to the MySQL command to execute
create function http_get returns string soname ‘mysql-udf-http.so‘;
create function http_post returns string soname ‘mysql-udf-http.so‘;
create function http_put returns string soname ‘mysql-udf-http.so‘;
create function http_delete returns string soname ‘mysql-udf-http.so‘;
Error: mysql-udf-http.so not found, command line input
Also early not to the file, it seems to have not installed successfully, look back to install diary, found errors:
gcc: /usr/local/lib/libcurl.so: No such file or directory
make[2]: *** [mysql-udf-http.la] Error 1
make[2]: Leaving directory `/usr/local/att/mysql-udf-http-1.0/src‘
make[1]: *** [all] Error 2
make[1]: Leaving directory `/usr/local/att/mysql-udf-http-1.0/src‘
make: *** [all-recursive] Error 1
Look at the front again.
[Email protected] mysql-udf-http-1.0> pkg_config_path=/usr/local/lib/pkgconfig:/usr/lib/ Pkgconfig
The suspect is the environment variable path set above is wrong, change to:
[[email protected] mysql-udf-http-1.0]# whereis pkgconfig
pkgconfig: /usr/lib/pkgconfig /usr/lib64/pkgconfig /usr/local/lib/pkgconfig /usr/share/pkgconfig
[[email protected] mysql-udf-http-1.0]# export PKG_CONFIG_PATH=/usr/lib64/pkgconfig:/usr/lib/pkgconfig
Re-execute:
cd mysql-udf-http-1.0/ ./configure --prefix=/usr/local/webserver/mysql --with-mysql=/usr/local/webserver/mysql/bin/mysql_config
make && make install
This time no error, but in the/usr/local/mysql/lib/plugin directory can not find mysql-udf-http.so, but in the/usr/local/mysql/lib directory to find mysql-udf-http.so, copy to/ After Usr/local/mysql/lib/plugin, perform
create function http_get returns string soname ‘mysql-udf-http.so‘;
create function http_post returns string soname ‘mysql-udf-http.so‘;
create function http_put returns string soname ‘mysql-udf-http.so‘;
create function http_delete returns string soname ‘mysql-udf-http.so‘;
The custom function was added successfully. The test successfully sends the request to the Web service.
centos6.5 Installing Mysql-udf-http Diary