Solved

/usr/bin/ld: cannot find -lmysqlclient_r

Posted on 2012-03-30
8
4,261 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
 
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
Ransomware-A Revenue Bonanza for Service Providers

Ransomware – malware that gets on your customers’ computers, encrypts their data, and extorts a hefty ransom for the decryption keys – is a surging new threat.  The purpose of this eBook is to educate the reader about ransomware 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 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

VMware Disaster Recovery and Data Protection

In this expert guide, you’ll learn about the components of a Modern Data Center. You will use cases for the value-added capabilities of Veeam®, including combining backup and replication for VMware disaster recovery and using replication for data center migration.

Question has a verified solution.

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

If you have a server on collocation with the super-fast CPU, that doesn't mean that you get it running at full power. Here is a preamble. When doing inventory of Linux servers, that I'm administering, I've found that some of them are running on l…
Fine Tune your automatic Updates for Ubuntu / Debian
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…
Learn how to get help with Linux/Unix bash shell commands. Use help to read help documents for built in bash shell commands.: Use man to interface with the online reference manuals for shell commands.: Use man to search man pages for unknown command…

910 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

21 Experts available now in Live!

Get 1:1 Help Now