Solved

/usr/bin/ld: cannot find -lmysqlclient_r

Posted on 2012-03-30
8
4,510 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 5
  • 3
8 Comments
 
LVL 78

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
Microsoft Certification Exam 74-409

Veeam® is happy to provide the Microsoft community with a study guide prepared by MVP and MCT, Orin Thomas. This guide will take you through each of the exam objectives, helping you to prepare for and pass the examination.

 
LVL 78

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 78

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

Webinar: Aligning, Automating, Winning

Join Dan Russo, Senior Manager of Operations Intelligence, for an in-depth discussion on how Dealertrack, leading provider of integrated digital solutions for the automotive industry, transformed their DevOps processes to increase collaboration and move with greater velocity.

Question has a verified solution.

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

Linux users are sometimes dumbfounded by the severe lack of documentation on a topic. Sometimes, the documentation is copious, but other times, you end up with some obscure "it varies depending on your distribution" over and over when searching for …
Join Greg Farro and Ethan Banks from Packet Pushers (http://packetpushers.net/podcast/podcasts/pq-show-93-smart-network-monitoring-paessler-sponsored/) and Greg Ross from Paessler (https://www.paessler.com/prtg) for a discussion about smart network …
Connecting to an Amazon Linux EC2 Instance from Windows Using PuTTY.
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.

759 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