Solved

/usr/bin/ld: cannot find -lmysqlclient_r

Posted on 2012-03-30
8
4,383 Views
Last Modified: 2012-04-18
hi ,
i am trying to install sysbench ..

when i installed mysql server via yum .. its works perfectly
but when i have install mysql via rpm -uvh My... 5.5
then i am having issues .

and i am follwing this one : http://www.serveradminblog.com/2010/02/sysbench-on-centos-howto/

after type :  ./configure
make
it through the error :
/usr/bin/ld: cannot find -lmysqlclient_r
collect2: ld returned 1 exit status
make[2]: *** [sysbench] Error 1


now when i checki config.log (~which created by configure ), i see the path

MYSQL_LIBS='-L/usr/lib64 -lmysqlclient_r -lpthread -lm -lrt -ldl'

so its taking /usr/lib64..
which suppose to ok because ..

 find / -name "libmysql*" -print
/usr/lib64/libmysqlclient_r.so.15.0.0
/usr/lib64/mysql/libmysqlclient.a
/usr/lib64/mysql/libmysqlclient_r.a
/usr/lib64/mysql/libmysqlservices.a
/usr/lib64/mysql/libmysqld-debug.a
/usr/lib64/mysql/libmysqld.a
/usr/lib64/libmysqlclient.so.12
/usr/lib64/libmysqlclient_r.so.14
/usr/lib64/libmysqlclient_r.so.14.0.0
/usr/lib64/libmysqlclient.so.16.0.0
/usr/lib64/libmysqlclient_r.so.15
/usr/lib64/libmysqlclient.so.16
/usr/lib64/libmysqlclient_r.so.12.0.0
/usr/lib64/libmysqlclient_r.so.16
/usr/lib64/libmysqlclient.so.15
/usr/lib64/libmysqlclient_r.so.12
/usr/lib64/libmysqlclient.so.15.0.0
/usr/lib64/libmysqlclient.so.14
/usr/lib64/libmysqlclient.so.14.0.0
/usr/lib64/libmysqlclient_r.so.16.0.0
/usr/lib64/libmysqlclient.so.12.0.0


i tryed to add bellow lline in .bashrc_profile

export LD_LIBRARY_PATH=/usr/lib64/mysql/


but i am not going anywhere
can any one please help me ..
thanks
0
Comment
Question by:fosiul01
  • 5
  • 3
8 Comments
 
LVL 77

Accepted Solution

by:
arnold earned 500 total points
ID: 37789024
Add the path to /etc/ld.so.conf
Sysbench might be a 32 bit app such that you need the 32 bit version of MySQL client libraries.

When you ran autogen.sh did you specify the target as 64 bit?
http://sysbench.sourceforge.net/docs/
0
 
LVL 29

Author Comment

by:fosiul01
ID: 37789052
from my config.log
its taking 64 bit ..


build='x86_64-redhat-linux-gnu'
build_alias=''
build_cpu='x86_64'
build_os='linux-gnu'
target='x86_64-redhat-linux-gnu'
target_alias=''
target_cpu='x86_64'
target_os='linux-gnu'
target_vendor='redhat'

funny is: taking getting

mysqlconfig='/usr/bin/mysql_config'

but cant find lib for mysql

what path shall i type in  /etc/ld.so.conf??
0
 
LVL 29

Author Comment

by:fosiul01
ID: 37789160
i did

cat /etc/ld.so.conf
include ld.so.conf.d/*.conf
/usr/lib64
/usr/lib64/mysql


then i typed

ldconfig

but sitill its same
0
PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

 
LVL 77

Expert Comment

by:arnold
ID: 37789181
Run file /usr/bin/mysql-config see whether it directs the path to the wrong location.
Look at the config.log points to for the failure.
Repeat the find, but do not limit  it to lib64 to see whether you have a 32 bit that is being found and rejected.
0
 
LVL 29

Author Comment

by:fosiul01
ID: 37789199
all looks perfect to me ..

config.log  (sysbench)

MYSQL_CFLAGS='-I/usr/include/mysql -g -pipe -Wp,-D_FORTIFY_SOURCE=2 -fexceptions                                                                              -fstack-protector --param=ssp-buffer-size=4 -m64 -fPIC -g -static-libgcc -fno-o                                                                             mit-frame-pointer -fno-strict-aliasing -DMY_PTHREAD_FASTMUTEX=1'
MYSQL_LIBS='-L/usr/lib64 -lmysqlclient_r -lpthread -lm -lrt -ldl'


mysql_config  :

 --cflags         [-I/usr/include/mysql -g -pipe -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -fPIC -g -static-libgcc -fno-omit-frame-pointer -fno-strict-aliasing -DMY_PTHREAD_FASTMUTEX=1]
        --include        [-I/usr/include/mysql]
        --libs           [-L/usr/lib64 -lmysqlclient -lpthread -lm -lrt -ldl]
        --libs_r         [-L/usr/lib64 -lmysqlclient_r -lpthread -lm -lrt -ldl]
        --plugindir      [/usr/lib64/mysql/plugin]
        --socket         [/var/lib/mysql/mysql.sock]
        --port           [0]
        --version        [5.5.22]
        --libmysqld-libs [-L/usr/lib64 -lmysqld -lpthread -lm -lrt -lcrypt -ldl -laio]
        --variable=VAR   VAR is one of:
                pkgincludedir [/usr/include/mysql]
                pkglibdir     [/usr/lib64]
                plugindir     [/usr/lib64/mysql/plugin]



see if you can find any problem..
0
 
LVL 77

Expert Comment

by:arnold
ID: 37789330
which version of redhat are you using?
try during configuration add LDFLAGS="-L/usr/lib64/mysql -L/usr/lib64/"

centos6,
LDFLAGS="-L/usr/lib64/mysql -L/usr/lib64" CC=gcc sh ./configure

when I ran make, it errors on X related issue. Is that the error you are looking at? are you in a Graphical mode environment or text based (runlevel N 3 versus N 5)?


../libtool: line 841: X--tag=CC: command not found
../libtool: line 874: libtool: ignoring unknown tag : command not found
../libtool: line 841: X--mode=link: command not found
../libtool: line 1007: *** Warning: inferring the mode of operation is deprecated.: command not found
../libtool: line 1008: *** Future versions of Libtool will require --mode=MODE be specified.: command not found
0
 
LVL 29

Author Comment

by:fosiul01
ID: 37789361
its if do

./configure LDFLAGS="-L/usr/lib64/mysql -L/usr/lib64/"


then i get
 drivers/mysql/libsbmysql.a -lmysqlclient_r -lpthread -ldl -lrt -lm: No such file or directory
../libtool: line 5168: X: command not found
../libtool: line 5172: : command not found
make[2]: Leaving directory `/root/sysbench-0.4.12/sysbench'


i am trying from putty .. and the server in runlevel 3.
and its centos 5.5
0
 
LVL 29

Author Comment

by:fosiul01
ID: 37789404
cant belived i did that!!
its becasue i never use rpm to install mysql 5.5!!! i always use source ....

i forgot to install   MySQL-shared-5.5.22-1.rhel5.x86_64.rpm


i installed  MySQL-shared-compat-5.5.22-2.rhel5.x86_64.rpm  but not the one i should install !!
after installing that one .. its  installed perfectly

while looking this
http://bugs.mysql.com/bug.php?id=59106

i realized that  let me check if i installed that or not ..
0

Featured Post

Master Your Team's Linux and Cloud Stack!

The average business loses $13.5M per year to ineffective training (per 1,000 employees). Keep ahead of the competition and combine in-person quality with online cost and flexibility by training with Linux Academy.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

As a database administrator, you may need to audit your table(s) to determine whether the data types are optimal for your real-world data needs.  This Article is intended to be a resource for such a task. Preface The other day, I was involved …
When table data gets too large to manage or queries take too long to execute the solution is often to buy bigger hardware or assign more CPUs and memory resources to the machine to solve the problem. However, the best, cheapest and most effective so…
Learn how to navigate the file tree with the shell. Use pwd to print the current working directory: Use ls to list a directory's contents: Use cd to change to a new directory: Use wildcards instead of typing out long directory names: Use ../ to move…
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.

840 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question