centos6.5安装mysql-udf-http日记
2015-12-04 22:36
573 查看
因为项目需要,数据库表更新后要实时推送消息给用户,想到用mysql-udf-http插件来给mysql提供http请求。
开始安装:
按照http://zyan.cc/mysql-udf-http/2/1/的方法安装,
执行到
的时候发现本机的mysql不是统一的目录(当前mysql是rpm的方式安装),目录比较乱,安装不成功。好吧,重装一个编译方式安装的mysql。
编译方式安装mysql:
按照/article/5348191.html方法安装。
Mysql安装路径为
继续安装mysql-udf-http
执行到这步的时候报错:
网上找到解决办法:
继续安装
到这里的时候想知道是否安装成功,到mysql命令执行
报错:找不到mysql-udf-http.so,命令行输入
也早不到该文件,看样子是没装成功,回头看安装日记,发现错误:
再看前面
怀疑是前面设置的环境变量路径错了,改成:
重新执行:
这次没报错,不过在/usr/local/mysql/lib/plugin目录下找不到mysql-udf-http.so,而是在/usr/local/mysql/lib目录下找到mysql-udf-http.so,拷贝到/usr/local/mysql/lib/plugin后,执行
添加自定义函数成功。经测试,成功发送请求到web服务。
开始安装:
按照http://zyan.cc/mysql-udf-http/2/1/的方法安装,
执行到
./configure --prefix=/usr/local/webserver/mysql --with-mysql=/usr/local/webserver/mysql/bin/mysql_config
的时候发现本机的mysql不是统一的目录(当前mysql是rpm的方式安装),目录比较乱,安装不成功。好吧,重装一个编译方式安装的mysql。
编译方式安装mysql:
按照/article/5348191.html方法安装。
Mysql安装路径为
/usr/local/mysql
继续安装mysql-udf-http
tar zxvf curl-7.21.1.tar.gz cd curl-7.21.1/ ./configure --prefix=/usr
执行到这步的时候报错:
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.
网上找到解决办法:
[root@iZ940ox5pn5Z mysql-udf-http-1.0]# whereis pkgconfig pkgconfig: /usr/lib/pkgconfig /usr/lib64/pkgconfig /usr/local/lib/pkgconfig /usr/share/pkgconfig [root@iZ940ox5pn5Z mysql-udf-http-1.0]# export \ > PKG_CONFIG_PATH=/usr/local/lib/pkgconfig:/usr/lib/pkgconfig
继续安装
tar zxvf mysql-udf-http-1.0.tar.gz cd mysql-udf-http-1.0/./configure --prefix=/usr/local/mysql --with-mysql=/usr/local/mysql/bin/mysql_config make && make install
到这里的时候想知道是否安装成功,到mysql命令执行
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';
报错:找不到mysql-udf-http.so,命令行输入
find /-name “mysql-udf-http.so”
也早不到该文件,看样子是没装成功,回头看安装日记,发现错误:
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
再看前面
[root@iZ940ox5pn5Z mysql-udf-http-1.0]# export \ > PKG_CONFIG_PATH=/usr/local/lib/pkgconfig:/usr/lib/pkgconfig
怀疑是前面设置的环境变量路径错了,改成:
[root@iZ940ox5pn5Z mysql-udf-http-1.0]# whereis pkgconfig pkgconfig: /usr/lib/pkgconfig /usr/lib64/pkgconfig /usr/local/lib/pkgconfig /usr/share/pkgconfig [root@iZ940ox5pn5Z mysql-udf-http-1.0]# export PKG_CONFIG_PATH=/usr/lib64/pkgconfig:/usr/lib/pkgconfig
重新执行:
cd mysql-udf-http-1.0/./configure --prefix=/usr/local/mysql --with-mysql=/usr/local/mysql/bin/mysql_config make && make install
这次没报错,不过在/usr/local/mysql/lib/plugin目录下找不到mysql-udf-http.so,而是在/usr/local/mysql/lib目录下找到mysql-udf-http.so,拷贝到/usr/local/mysql/lib/plugin后,执行
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';
添加自定义函数成功。经测试,成功发送请求到web服务。
相关文章推荐
- 网络流问题
- Ubuntu中启用关闭Network-manager网络设置问题!
- JAVA HTTP POST参数为一个对象或数组
- JAVA HTTP POST参数为一个对象或数组
- iOS 网络与多线程--6.下载并保存网络图片
- nodejs发起HTTPS请求并获取数据
- poj--1637--Sightseeing tour(网络流,最大流判断混合图是否存在欧拉图)
- poj--1637--Sightseeing tour(网络流,最大流判断混合图是否存在欧拉图)
- UNIX网络编程笔记(6):I/O复用之select函数
- centos下httpd-2.4的编译安装
- centos下httpd-2.4的编译安装
- 基于AFNetworking3.0的网络封装
- iOS 网络与多线程--5.异步Post方式的网络请求(非阻塞)
- Nginx实现多域名证书HTTPS
- HTTP 2.0 协议详解
- HTTPS重用Session ID与负载均衡
- 解决TCP网络传输“粘包”问题
- 第五天 网络配置和文件服务器
- java http post json
- HTTP协议的状态码