Solved

/usr/bin/ld: cannot find -lmysqlclient_r

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

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.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
capture pcap with filtered traffic 1 61
when to use sequences in mysql 4 27
ignore other .htaccess 2 45
Restore of mysql database from .SQL file - using Coldfusion 5 36
Introduction We as admins face situation where we need to redirect websites to another. This may be required as a part of an upgrade keeping the old URL but website should be served from new URL. This document would brief you on different ways ca…
Creating and Managing Databases with phpMyAdmin in cPanel.
Learn several ways to interact with files and get file information from the bash shell. ls lists the contents of a directory: Using the -a flag displays hidden files: Using the -l flag formats the output in a long list: The file command gives us mor…
Connecting to an Amazon Linux EC2 Instance from Windows Using PuTTY.

770 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