libgearman.so.8 "No such file or directory"

Asked by Sam

Hi, I'm using ubuntu 14.04 LTS desktop version
Fail comes the last step when create function

SQL:
CREATE FUNCTION gman_do RETURNS STRING SONAME "libgearman_mysql_udf.so" Error Code: 1126. Can't open shared library 'libgearman_mysql_udf.so' (errno: 11 libgearman.so.8: cannot open shared object file: No such file or directory)

Files created successfully before in /usr/lib/mysql/plugin

-rwxr-xr-x 1 root root 1026 libgearman_mysql_udf.la*
lrwxrwxrwx 1 root root 29 libgearman_mysql_udf.so -> libgearman_mysql_udf.so.0.0.0*
lrwxrwxrwx 1 root root 29 libgearman_mysql_udf.so.0 -> libgearman_mysql_udf.so.0.0.0*
-rwxr-xr-x 1 root root 132472 libgearman_mysql_udf.so.0.0.0*

libs can seen in path

# ldconfig -v | grep libgearman
/sbin/ldconfig.real: Path `/usr/local/lib' given more than once
/sbin/ldconfig.real: Path `/lib/x86_64-linux-gnu' given more than once
/sbin/ldconfig.real: Path `/usr/lib/x86_64-linux-gnu' given more than once
/sbin/ldconfig.real: /lib/x86_64-linux-gnu/ld-2.19.so is the dynamic linker, ignoring

 libgearman.so.8 -> libgearman.so.8.0.0

Question information

Language:
English Edit question
Status:
Solved
For:
Gearman MySQL UDF Edit question
Assignee:
No assignee Edit question
Solved by:
Sam
Solved:
Last query:
Last reply:
Revision history for this message
Manfred Hampl (m-hampl) said :
#1

What is the output of the terminal commands

sudo updatedb
locate libgearman.so
ls -l `locate libgearman.so`

Revision history for this message
Sam (yhy90923) said :
#2

root@jige-virtual-machine:/home/jige# sudo updatedb
root@jige-virtual-machine:/home/jige# locate libgearman.so
/home/jige/share/gearmand-1.1.12/libgearman/.libs/libgearman.so
/home/jige/share/gearmand-1.1.12/libgearman/.libs/libgearman.so.8
/home/jige/share/gearmand-1.1.12/libgearman/.libs/libgearman.so.8.0.0
/usr/local/lib/libgearman.so
/usr/local/lib/libgearman.so.8
/usr/local/lib/libgearman.so.8.0.0
root@jige-virtual-machine:/home/jige# ls -l `locate libgearman.so`
lrwxrwxrwx 1 root root 19 7-29 17:13 /home/jige/share/gearmand-1.1.12/libgearman/.libs/libgearman.so -> libgearman.so.8.0.0
lrwxrwxrwx 1 root root 19 7-29 17:13 /home/jige/share/gearmand-1.1.12/libgearman/.libs/libgearman.so.8 -> libgearman.so.8.0.0
-rwxr-xr-x 1 root root 1433222 7-29 17:13 /home/jige/share/gearmand-1.1.12/libgearman/.libs/libgearman.so.8.0.0
lrwxrwxrwx 1 root root 19 7-29 17:18 /usr/local/lib/libgearman.so -> libgearman.so.8.0.0
lrwxrwxrwx 1 root root 19 7-29 17:18 /usr/local/lib/libgearman.so.8 -> libgearman.so.8.0.0
-rwxr-xr-x 1 root root 1433222 7-29 17:18 /usr/local/lib/libgearman.so.8.0.0

Revision history for this message
Manfred Hampl (m-hampl) said :
#3

What is the output of the commands

ldd /usr/lib/mysql/plugin/libgearman_mysql_udf.so
echo $LD_LIBRARY_PATH
LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/lib ldd /usr/lib/mysql/plugin/libgearman_mysql_udf.so

Revision history for this message
Sam (yhy90923) said :
#4

root@jige-virtual-machine:/home/jige# ldd /usr/lib/mysql/plugin/libgearman_mysql_udf.so
 linux-vdso.so.1 => (0x00007fffec1fe000)
 libgearman.so.8 => /usr/local/lib/libgearman.so.8 (0x00007f8fa18ff000)
 libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007f8fa1522000)
 libdl.so.2 => /lib/x86_64-linux-gnu/libdl.so.2 (0x00007f8fa131d000)
 libuuid.so.1 => /lib/x86_64-linux-gnu/libuuid.so.1 (0x00007f8fa1118000)
 libstdc++.so.6 => /usr/lib/x86_64-linux-gnu/libstdc++.so.6 (0x00007f8fa0e14000)
 libgcc_s.so.1 => /lib/x86_64-linux-gnu/libgcc_s.so.1 (0x00007f8fa0bfd000)
 /lib64/ld-linux-x86-64.so.2 (0x00007f8fa1d2f000)
 libm.so.6 => /lib/x86_64-linux-gnu/libm.so.6 (0x00007f8fa08f7000)
root@jige-virtual-machine:/home/jige# echo $LD_LIBRARY_PATH
/usr/local/lib
root@jige-virtual-machine:/home/jige# LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/lib ldd /usr/lib/mysql/plugin/libgearman_mysql_udf.so
 linux-vdso.so.1 => (0x00007fff9e591000)
 libgearman.so.8 => /usr/local/lib/libgearman.so.8 (0x00007fefd641b000)
 libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007fefd603e000)
 libdl.so.2 => /lib/x86_64-linux-gnu/libdl.so.2 (0x00007fefd5e39000)
 libuuid.so.1 => /lib/x86_64-linux-gnu/libuuid.so.1 (0x00007fefd5c34000)
 libstdc++.so.6 => /usr/lib/x86_64-linux-gnu/libstdc++.so.6 (0x00007fefd5930000)
 libgcc_s.so.1 => /lib/x86_64-linux-gnu/libgcc_s.so.1 (0x00007fefd5719000)
 /lib64/ld-linux-x86-64.so.2 (0x00007fefd684b000)
 libm.so.6 => /lib/x86_64-linux-gnu/libm.so.6 (0x00007fefd5413000)

Revision history for this message
Manfred Hampl (m-hampl) said :
#5

The ldd command does correctly find the libgearman.so.8 library.
I do not see any reason why your original command (SQL) fails with "no such file".

Just for completeness' sake please provide the output of

grep -n '/usr/local/lib' /etc/ld.so.conf /etc/ld.so.conf.d/*.conf

Revision history for this message
Sam (yhy90923) said :
#6

root@jige-virtual-machine:/home/jige# grep -n '/usr/local/lib' /etc/ld.so.conf /etc/ld.so.conf.d/*.conf
/etc/ld.so.conf:2:/usr/local/lib
/etc/ld.so.conf.d/libc.conf:2:/usr/local/lib

Can this problem comes when has build errors or others ? Like the files have errors then they are ignored by mysql or system
Or the bug of the mysql ( Ver 14.14 Distrib 5.6.26, for Linux (x86_64) using EditLine wrapper )?

Revision history for this message
Sam (yhy90923) said :
#7

Solved.
Seems that /usr/local/lib is not a good folder,
I just make some link in the /usr/lib/ then the functions created successfully
I'm trying that if the funcs are running good

:/usr/lib# ln /usr/local/lib/libgearman.so.8 libgearman.so
:/usr/lib# ln /usr/local/lib/libgearman.so.8 libgearman.so.8
:/usr/lib# ln /usr/local/lib/libgearman.so.8.0.0 libgearman.so.8.0.0

# find / -name 'libgearman.so*'
/usr/lib/libgearman.so.8
/usr/lib/libgearman.so.8.0.0
/usr/lib/libgearman.so
/usr/local/lib/libgearman.so.8
/usr/local/lib/libgearman.so.8.0.0
/usr/local/lib/libgearman.so

Revision history for this message
vamsikrishna (vamsi-kopalle) said :
#8

]$ldconfig -v | grep netlog
/sbin/ldconfig.real: Path `/lib/x86_64-linux-gnu' given more than once
/sbin/ldconfig.real: Path `/usr/lib/x86_64-linux-gnu' given more than once
/sbin/ldconfig.real: /lib/x86_64-linux-gnu/ld-2.19.so is the dynamic linker, ignoring

        liblibcli-netlogon3.so.0 -> liblibcli-netlogon3.so.0
        liblibcli-netlogon3.so.0 -> liblibcli-netlogon3.so.0
        liblibcli-netlogon3.so.0 -> liblibcli-netlogon3.so.0
        liblibcli-netlogon3.so.0 -> liblibcli-netlogon3.so.0

I have noticed some errors while running ldconfig with respect paths of libraries.
$echo $LD_LIBRARY_PATH

library path is blank. Please suggest a solution on how to resolve this issue.