site Search:


 
    All Forums Hot Topics Gallery






how-to block ads


 
Search Topic:
Uniqs:
475
Share Topic
Posting?
Post a:
Post a:
Links: ·Forum FAQ ·Attitude Adjustment ·Linux docs ·DistroWatch ·OPLM ·FreeBSD Handbook
AuthorAll Replies


Nick
Purveyor of common sense
Premium,VIP,MVM
join:2000-10-29
Smithtown, NY

Can't install the DBD::mysql package on Ubuntu

I'm trying to install the DBD::mysql interface to have Perl scripts interface with a local MySQL database....However, I keep getting an error message when I install from CPAN:

LD_RUN_PATH="/lib/i386-linux-gnu" /usr/bin/perl myld cc  -shared -O2 -g -L/usr/local/lib -fstack-protector dbdimp.o mysql.o  -o blib/arch/auto/DBD/mysql/mysql.so \
   -L/usr/lib -lmysqlclient -lpthread -lm -lrt -ldl  \
  
/usr/bin/ld: cannot find -lmysqlclient
collect2: ld returned 1 exit status
make: *** [blib/arch/auto/DBD/mysql/mysql.so] Error 1
  CAPTTOFU/DBD-mysql-4.020.tar.gz
  /usr/bin/make -- NOT OK
'YAML' not installed, will not store persistent state
Running make test
  Can't test without successful make
Running make install
  Make had returned bad status, install seems impossible
Failed during this command:
 CAPTTOFU/DBD-mysql-4.020.tar.gz              : make NO
 

What's interesting is that if I list my lib directory there's a mysql subdirectory that has the mysqlclient libraries

ubuntu-user@desktop:/usr/lib$ ls | grep mysql
libmysqlclient_r.so.16
libmysqlclient_r.so.16.0.0
libmysqlclient.so.16
libmysqlclient.so.16.0.0
mysql
 
 

--
-Stupidity, like hydrogen, is one of the basic building blocks of the Universe.
-Insanity: doing the same thing over and over again and expecting different results.

Misc


Steve
I know your IP address
Consultant
join:2001-03-10
Yorba Linda, CA
kudos:5

The dot-so files are the shared objects that the executables load, but you still need the dot-a files to link against (the -lmysqlclient parameter).

I don't know what Ubuntu uses for packaging, but on CentOS it's the mysql-devel package.



Nick
Purveyor of common sense
Premium,VIP,MVM
join:2000-10-29
Smithtown, NY

reply to Nick
ubuntu-user@desktop:/usr/lib/mysql$ ls
libmygcc.a libmysqlclient.a libmysqlclient_r.a libmysqlservices.a plugin
ubuntu-user@desktop:/usr/lib/mysql$

one of these?



Steve
I know your IP address
Consultant
join:2001-03-10
Yorba Linda, CA
kudos:5

Yes, so it's apparent that perl is not finding the libraries. I see -L/usr/lib but not -L/usr/lib/mysql in the path, so it's somehow not looking in the right places for them. I dunno how to tell the perl code to look there, but that's the gist of the issue.



Nick
Purveyor of common sense
Premium,VIP,MVM
join:2000-10-29
Smithtown, NY

reply to Nick
So just to clarify, mysqlclient.a is equivalent to libmysqlclient.a? (Normally I would say no...but I haven't done a lot of Linux for a long time)



Steve
I know your IP address
Consultant
join:2001-03-10
Yorba Linda, CA
kudos:5

said by Nick:

So just to clarify, mysqlclient.a is equivalent to libmysqlclient.a?

No; the former doesn't really mean anything, while the latter (libmysqlclient.a) is summoned by -lmysqlclient on the linker command line.


Maxo
Your tax dollars at work.
Premium,VIP
join:2002-11-04
Tallahassee, FL

reply to Nick
You should be able to do this by just installing a package. I think libmysqlclient16 and libmysqlclient-dev are what you need.
sudo apt-get install libmysqlclient16 libmysqlclient-dev


Sunday, 03-Jun 18:24:41 Terms of Use & Privacy | feedback | contact | Hosting by nac.net - DSL,Hosting & Co-lo
over 12.5 years online © 1999-2012 dslreports.com.
Most commented news this week
Hot Topics