因为项目需要,数据库表更新后要实时推送消息给用户,想到用mysql-udf-http插件来给mysql提供http请求。

开始安装:

按照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

按照http://www.cnblogs.com/xiongpq/p/3384681.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' foundConsider adjusting the PKG_CONFIG_PATH environment variable if youinstalled software in a non-standard prefix.Alternatively, you may set the environment variables DEPS_CFLAGSand 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 pkgconfigpkgconfig: /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 directorymake[2]: *** [mysql-udf-http.la] Error 1make[2]: Leaving directory `/usr/local/att/mysql-udf-http-1.0/src'

make[1]: *** [all] Error 2make[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 pkgconfigpkgconfig: /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服务。

转载于:https://www.cnblogs.com/yudaxian/p/5020747.html

centos6.5安装mysql-udf-http日记相关推荐

  1. Mysql系列三:Centos6下安装Mysql和Mysql主从复制的搭建

    一.Centos6下安装Mysql 检测下系统有没有自带的mysql:yum list installed | grep mysql,  如果已经有的话执行命令yum -y remove mysql- ...

  2. centos6.4 安装mysql

    安装环境   centos x86_64 最小化安装 安装  "development tools"  "server platform development" ...

  3. centos6.8安装mysql打不开,Centos6.8安装Mysql5.7

    1.下载 wget https://dev.mysql.com/get/mysql57-community-release-el6-9.noarch.rpm 2.安装用来配置mysql的yum源的rp ...

  4. centos 6 安装mysql,CentOS6.5安装MySQL教程(完整教程)

    Step 1:检测系统是否安装MYSQL# yum list installed | grep mysql 顺便提下如果yum有如下提示不能用的情况: yum在自动更新 原因是yum在自动更新 只要关 ...

  5. Linux centos6.5 安装mysql 以及简要操作书册

    文章目录 安装mysql 1.查看自己虚拟机有没有mysql的安装包 2.卸载(可选) 4.安装mysql服务: 5.安装完成之后 6.查看mysql的服务 7.开启mysqld的服务 8.进入mys ...

  6. centos6.4安装mysql的过程中出现的bug

    我今天安了一个mysql,下载一个源码包,感觉很简单,tar,./configure,make,make install 经典四步,弄这个也不是第一次了,但今天就是老出错,首先是./configure ...

  7. 6、单机运行环境搭建之 --CentOS-6.4安装MySQL 5.6.10并修改MySQL的root用户密码

    Mysql 5.5以后使用了CMake进行安装,参考与以前的区别请参考: http://www.blogjava.net/kelly859/archive/2012/09/04/387005.html ...

  8. 单机运行环境搭建之 --CentOS-6.4安装MySQL 5.6.10并修改MySQL的root用户密码

    来源:http://www.cnblogs.com/littlehb/archive/2013/04/02/2995007.html Mysql 5.5以后使用了CMake进行安装,参考与以前的区别请 ...

  9. Hive的安装-Mysql安装

    Hive 的安装 这里我们选用hive的版本是3.1.0这个release版本,可以兼容我们对应的hadoop3.x的版本 下载地址为: http://archive.apache.org/dist/ ...

  10. centos6.5 mysql下载_Centos6.5在线安装mysql 8.0详细教程

    Centos6.5在线安装mysql 8.0的顺序如下,希望大家可以顺利进行安装. Mysql卸载从下往上顺序 [root@localhost /]# rpm -e --nodeps qt-MySQL ...

最新文章

  1. Android安卓APK反编译逆向
  2. 详解-OTUS(大津法-最大类间方差)原理及C语言代码实现
  3. C# WinForm开发系列 - 开篇
  4. 为什么我只写微头条,粉丝一天就增加700多人?
  5. SAS Viya调研概述
  6. 学python买什么书-关于 Python 的经典入门书籍有哪些?
  7. web.xml 总结
  8. 野哥点评了Facebook、Amazon、Google、微软和苹果
  9. android java 图形_java – 在Android中呈现的图像上的锯齿状边缘
  10. unity3d中串口的使用
  11. dotnet core项目升级到 .net core 2.0
  12. 数学建模之Python-微分方程建模实例
  13. 乐忧商城项目总结-5
  14. calibre转换电子书格式教程
  15. 国内手机市场遭遇寒风,智能手机企业激战千元机
  16. HTML简单动画制作
  17. 一种基于蓝牙的电视锁实现方案
  18. 谷歌母公司一季度营收363亿美元 计提欧盟罚款后净利润仍超过66亿美元
  19. 解决$ is not defined 的几种方法
  20. IE 今天正式停用!网友炸锅了

热门文章

  1. NYOJ 608 508筹划工程 HDU 1232 畅通工程
  2. 【洛谷P3366】最小生成树(kruskal模版题+prim链式加边)
  3. beego mysql增删改查_5-BeegoORM增删改查-Go语言中文社区
  4. MATLAB--查表
  5. mysql 教学方法总结_MySQL教程之MySQL知识总结
  6. 翻译: 3.线性神经网络 概览 深入神经网络 pytorch
  7. 机器学习- 吴恩达Andrew Ng Week6 知识总结 Machine Learning System Design
  8. 算法:投票Voting
  9. 巨人 index.php/user/login,dedecms实现首页顶部会员登陆框的方法
  10. 3d安卓环境搭建_RoboCup 仿真3D简介及环境搭建