Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Installing DBD Mysql 1

Status
Not open for further replies.

axman505

Technical User
Jun 20, 2001
489
US
Greetings,

I am trying to install DBD::mysql on my redhat 8 system running perl 5.8. THere is my problem. I have an rpm install of perl from redhat, but apache,php,mysql are compiled from source and installed. So how do i get perl to talk to mysql, since it is not intalled in the default location. Along with being able to compiled DBD::mysql.

Currently, here are the errors while compiling:

[root@Alpha DBD-mysql-2.9003]# perl Makefile.PL --testdb=test --testpassword=dbtest --testuser=dbtest --testhost=localhost
I will use the following settings for compiling and testing:

cflags (mysql_config) = -I'/usr/include'
libs (mysql_config) = -L/usr/lib -lmysqlclient -lz -lcrypt -lnsl -lm
nocatchstderr (default ) = 0
nofoundrows (default ) = 0
ssl (guessed ) = 0
testdb (Users choice) = test
testhost (Users choice) = localhost
testpassword (Users choice) = dbtest
testuser (Users choice) = dbtest

To change these settings, see 'perl Makefile.PL --help' and
'perldoc INSTALL'.

Note (probably harmless): No library found for -lmysqlclient
Multiple copies of Driver.xst found in: /usr/lib/perl5/site_perl/5.8.0/i386-linux-thread-multi/auto/DBI /usr/lib/perl5/vendor_perl/5.8.0/i386-linux-thread-multi/auto/DBI at Makefile.PL line 295
Using DBI 1.40 (for perl 5.008 on i386-linux-thread-multi) installed in /usr/lib/perl5/site_perl/5.8.0/i386-linux-thread-multi/auto/DBI
Writing Makefile for DBD::mysql
[root@Alpha DBD-mysql-2.9003]#
 
axman,
I installed DBD-mysql last week and encountered the same problem with my MacOSX installation. After a bit of reading I finally got it working.
If you run mysql_config, which should be in the bin directory for your mysql installation it will return the configuration settings, which you can than pass to the perl Makefile.pl command as shown in the README for DBD-mysql.
For instance, on my box mysql_config returned:
Code:
$> mysql_config
Usage: /Library/MySQL/bin/mysql_config [OPTIONS]
Options:
        --cflags         [-I'/Library/MySQL/include/mysql']
        --libs           [-L'/Library/MySQL/lib/mysql' -lmysqlclient -lz -lm -L/usr/lib -lssl -lcrypto]
        --socket         [/tmp/mysql.sock]
        --port           [3306]
        --version        [4.0.15]
        --libmysqld-libs [ -L'/Library/MySQL/lib/mysql' -lmysqld -lz -lm   ]

Then following the example in the README added the --lib, --cflags and --libmysqld-libs arguments to perl Makefile.pl as follows:

Code:
perl Makefile.PL  --libs="-L'/Library/MySQL/lib/mysql' -lmysqlclient -lz -lm -L/usr/lib -lssl -lcrypto"  --cflags="-I'/Library/MySQL/include/mysql'"  --libmysqld-libs="-L'/Library/MySQL/lib/mysql' -lmysqld -lz -lm"

Worked for me and I finally got it installed after finding out that there was also a "bug" in the Config.pm in the perl 5.8 installation shipped with the MacOSX. I suspect that latter is not the case with your RedHat install.
I'm writing this from memory and, unfortunately, didn't take notes while doing so, but I think I've got it all.
Good luck. Hope this helps.
Derek
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top