下载mysql-udf-http-1.0.tar.gz
链接:https://pan.baidu.com/s/1PslMSdeqDUE98GnYbG6d8g 提取码:a740
安装
yum install -y libcurl* tar -zxvf mysql-udf-http-1.0.tar.gz cd mysql-udf-http-1.0 vi src/mysql-udf-http.c //mysql8中没有my_bool数据类型,需要替换成bool :%s/my_bool/bool/g //--with-mysql替换成自己mysql安装包的路径 ./configure --prefix=/usr/local/mysql-udf-http --with-mysql=/usr/local/mysql/bin/mysql_config make && make install //创建软连接 ln -s /usr/local/mysql-udf-http/lib/mysql/plugin/mysql-udf-http.so.0.0.0 /usr/local/mysql/lib/plugin/mysql-udf-http.so
创建函数
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';
发送请求
select CAST(http_get('http://www.baidu.com') AS CHAR CHARACTER SET utf8) as result
其他 *** 作见作者博客
http://zyan.cc/mysql-udf-http/
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)