1
votes

Installing MySQL JSON UDFs

Step 1: mysql> show variables like 'plugin_dir';

+--------------------+--------------------------+

| Variable_name | Value |

+--------------------+--------------------------+

| plugin_dir | /usr/lib64/mysql/plugin/ |

+--------------------+--------------------------+

Step 2: Bellow command run on Linux/ Vagrant

$ wget http://downloads.mysql.com/snapshots/pb/mysql-json-udfs-0.3.0/mysql-json-udfs-0.3.0-labs-json-udfs-linux-glibc2.5-x86_64.tar.gz

$ tar xvf mysql-json-udfs-0.3.0-labs-json-udfs-linux-glibc2.5-x86_64.tar.gz

$ cp -i mysql-json-udfs-0.3.0-labs-json-udfs-linux-glibc2.5-x86_64/libmy_json_udf.so /usr/lib64/mysql/plugin/.

Step 3: mysql> create function json_extract returns string soname 'libmy_json_udf.so';

It will gives error--

ERROR 1126 (HY000): Can't open shared library 'libmy_json_udf.so'

How to resolve this issue?

I want result like as folows,

mysql> select json_extract('{"a":1,"b":2}','b');

+-----------------------------------+

| json_extract('{"a":1,"b":2}','b') |

+-----------------------------------+

| 2 |

+-----------------------------------+

Thanks.

1

1 Answers

0
votes

http://bugs.mysql.com/bug.php?id=71265

As suggested in MySQL bug tracker, a workaround is to symlink the libraries

root:/usr/lib/x86_64-linux-gnu# ln -s libpcreposix.so libpcreposix.so.0
root:/usr/lib/x86_64-linux-gnu# ln -s libpcre.so libpcre.so.0

Another workaround is to use cmake option WITH_PCRE=bundled