MySQL安装mysql-udf-http

直接看作者 文档

mysql-udf-http作者的项目说明: http://blog.zyan.cc/mysql-udf-http/
Google访问不了,可以搜索其他下载地址

注意点1

echo "/usr/local/webserver/mysql/lib/mysql/" > /etc/ld.so.conf.d/mysql.conf

通常这个应该是这样,lib/后面不需要其他内容:

echo "/usr/local/mysql/lib/" > /etc/ld.so.conf.d/mysql.conf

注意点2

在执行./configure --prefix=/usr/local/mysql --with-mysql=/usr/local/mysql/bin/mysql_config 时候

checking for DEPS... configure: error: Package requirements (libcurl >= 7.15) were not met:
No package 'libcurl' found

这个找不到libcurl,文档第一步就是安装curl,如果安装失败,检查原因重新安装。如果成功了,可以自己手动找一下

[root@localhost mysql-udf-http-1.0]# which curl
/usr/bin/curl
[root@localhost mysql-udf-http-1.0]# find / -name libcurl.pc
/home/mysql/curl-7.21.1/libcurl.pc
/usr/lib/pkgconfig/libcurl.pc
[root@localhost mysql-udf-http-1.0]# cp /usr/lib/pkgconfig/libcurl.pc /usr/lib64/pkgconfig/

这里系统lib里面有这个文件,因为是64位系统,所以位置不对。cp过去就行了。

注意点3

在执行make && make install安装mysql-udf-http-1.0时报错:

cd mysql-udf-http-1.0/
./configure --prefix=/usr/local/webserver/mysql --with-mysql=/usr/local/webserver/mysql/bin/mysql_config
make && make install

错误如下:

ERROR 1126 (HY000): Can't open shared library 'mysql-udf-http.so' (errno: 2 /usr/local/mysql/lib/plugin/mysql-udf-http.so: cannot open shared object file: No such file or directory)

原因是找不到这个文件,errno: 2 /usr/local/mysql/lib/plugin/mysql-udf-http.so: cannot open shared object file: No such file or directory,

[root@localhost mysql-udf-http-1.0]# find / -name mysql-udf-http.so
/home/mysql/mysql-udf-http-1.0/src/.libs/mysql-udf-http.so
/usr/local/mysql/lib/mysql-udf-http.so

文件没有在plugin目录,而是在plugin的上级目录里。

[root@localhost mysql-udf-http-1.0]# ls /usr/local/mysql/lib/
libmysqlclient.a            libmysqlclient.so         mysql-udf-http.la
libmysqlclient_r.a          libmysqlclient.so.18      mysql-udf-http.so
libmysqlclient_r.so         libmysqlclient.so.18.1.0  mysql-udf-http.so.0
libmysqlclient_r.so.18      libmysqlservices.a        mysql-udf-http.so.0.0.0
libmysqlclient_r.so.18.1.0  mysql-udf-http.a          plugin
[root@localhost mysql-udf-http-1.0]# cp /usr/local/mysql/lib/mysql-udf-* /usr/local/mysql/lib/plugin/
[root@localhost mysql-udf-http-1.0]# ls /usr/local/mysql/lib/plugin/            adt_null.so           mypluglib.so             qa_auth_client.so
auth.so               mysql_no_login.so        qa_auth_interface.so
auth_socket.so        mysql-udf-http.a         qa_auth_server.so
auth_test_plugin.so   mysql-udf-http.la        test_udf_services.so
daemon_example.ini    mysql-udf-http.so        validate_password.so
debug                 mysql-udf-http.so.0
libdaemon_example.so  mysql-udf-http.so.0.0.0

最后成功安装后是这样:

[root@localhost mysql-udf-http-1.0]# mysql -u root -p                           Enter password:
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 17
Server version: 5.6.32 Source distribution

Copyright (c) 2000, 2016, Oracle and/or its affiliates. All rights reserved.

Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

mysql> create function http_get returns string soname 'mysql-udf-http.so';
Query OK, 0 rows affected (0.00 sec)

你可能感兴趣的:(MySQL安装mysql-udf-http)