Solved

/usr/bin/ld: cannot find -lmysqlclient_r

Posted on 2012-03-30
8
4,210 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 76

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
 
LVL 76

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
6 Surprising Benefits of Threat Intelligence

All sorts of threat intelligence is available on the web. Intelligence you can learn from, and use to anticipate and prepare for future attacks.

 
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 76

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

Highfive + Dolby Voice = No More Audio Complaints!

Poor audio quality is one of the top reasons people don’t use video conferencing. Get the crispest, clearest audio powered by Dolby Voice in every meeting. Highfive and Dolby Voice deliver the best video conferencing and audio experience for every meeting and every room.

Join & Write a Comment

Foreword In the years since this article was written, numerous hacking attacks have targeted password-protected web sites.  The storage of client passwords has become a subject of much discussion, some of it useful and some of it misguided.  Of cou…
Introduction Since I wrote the original article about Handling Date and Time in PHP and MySQL (http://www.experts-exchange.com/articles/201/Handling-Date-and-Time-in-PHP-and-MySQL.html) several years ago, it seemed like now was a good time to updat…
Learn how to find files with the shell using the find and locate commands. Use locate to find a needle in a haystack.: With locate, check if the file still exists.: Use find to get the actual location of the file.:
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.

706 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

Need Help in Real-Time?

Connect with top rated Experts

20 Experts available now in Live!

Get 1:1 Help Now