Hello all. I am getting my feet wet with MySQL and DBI. I am running
Linux 2.4.29, Debian 3.1, Perl 5.8.7, MySQL 4.1.11, and DBI version
1.50. To teach myself, I have been (re-)working my way through Paul
DuBois' 'MySQL' book, first edition. I've had no problem connecting to
the server with the 'mysql' client and running the test exercises. So
now I'm up to the chapter on the Perl DBI.
The DBI *per se* I should have no problem with, because I've installed
it in the past for SQLite. But today I have had a difficult time
getting DBD::mysql to install. I first tried through the 'cpan' shell
and failed at 'make test'. I had to stop for a couple of hours; when I
came back to my desk I decided to try to install it manually. I went to
the directory where everything had been unwrapped earlier:
~/.cpan/build/DBD-mysql-3.0002. I got through 'perl Makefile.PL' and
'make' more or less unscathed.
[DBD-mysql-3.0002] 690 $ sudo perl Makefile.PL
I will use the following settings for compiling and testing:
cflags (mysql_config) = -I/usr/include/mysql -DBIG_JOINS=1
embedded (mysql_config) =
libs (mysql_config) = -L/usr/lib -lmysqlclient -lz -lcrypt
-lnsl -lm
mysql_config (guessed ) = mysql_config
nocatchstderr (default ) = 0
nofoundrows (default ) = 0
ssl (guessed ) = 0
testdb (default ) = test
testhost (default ) =
testpassword (default ) =
testsocket (default ) =
testuser (default ) =
To change these settings, see 'perl Makefile.PL --help' and
'perldoc INSTALL'.
Checking if your kit is complete...
Looks good
Using DBI 1.50 (for perl 5.008007 on i686-linux) installed in
/usr/local/lib/perl5/site_perl/5.8.7/i686-linux/auto/DBI/
Writing Makefile for DBD::mysql
[DBD-mysql-3.0002] 691 $ sudo make
cp lib/DBD/mysql.pm blib/lib/DBD/mysql.pm
cp lib/DBD/mysql/GetInfo.pm blib/lib/DBD/mysql/GetInfo.pm
cp lib/Mysql.pm blib/lib/Mysql.pm
cp lib/DBD/mysql/INSTALL.pod blib/lib/DBD/mysql/INSTALL.pod
cp lib/Mysql/Statement.pm blib/lib/Mysql/Statement.pm
cp lib/Bundle/DBD/mysql.pm blib/lib/Bundle/DBD/mysql.pm
cc -c -I/usr/local/lib/perl5/site_perl/5.8.7/i686-linux/auto/DBI/
-I/usr/include/mysql -DBIG_JOINS=1 -DDBD_MYSQL_INSERT_ID_IS_GOOD -g
-fno-strict-aliasing -pipe -I/usr/local/include -D_LARGEFILE_SOURCE
-D_FILE_OFFSET_BITS=64 -O2 -DVERSION=\"3.0002\"
-DXS_VERSION=\"3.0002\" -fpic
"-I/usr/local/lib/perl5/5.8.7/i686-linux/CORE" dbdimp.c
/usr/local/bin/perl -p -e "s/~DRIVER~/mysql/g"
/usr/local/lib/perl5/site_perl/5.8.7/i686-linux/auto/DBI//Driver.xst >
mysql.xsi
/usr/local/bin/perl /usr/local/lib/perl5/5.8.7/ExtUtils/xsubpp -typemap
/usr/local/lib/perl5/5.8.7/ExtUtils/typemap mysql.xs > mysql.xsc && mv
mysql.xsc mysql.c
Warning: duplicate function definition 'do' detected in mysql.xs, line 224
Warning: duplicate function definition 'rows' detected in mysql.xs, line 559
cc -c -I/usr/local/lib/perl5/site_perl/5.8.7/i686-linux/auto/DBI/
-I/usr/include/mysql -DBIG_JOINS=1 -DDBD_MYSQL_INSERT_ID_IS_GOOD -g
-fno-strict-aliasing -pipe -I/usr/local/include -D_LARGEFILE_SOURCE
-D_FILE_OFFSET_BITS=64 -O2 -DVERSION=\"3.0002\"
-DXS_VERSION=\"3.0002\" -fpic
"-I/usr/local/lib/perl5/5.8.7/i686-linux/CORE" mysql.c
Running Mkbootstrap for DBD::mysql ()
chmod 644 mysql.bs
rm -f blib/arch/auto/DBD/mysql/mysql.so
LD_RUN_PATH="/usr/lib" /usr/local/bin/perl myld cc -shared
-L/usr/local/lib dbdimp.o mysql.o -o blib/arch/auto/DBD/mysql/mysql.so
-L/usr/lib -lmysqlclient -lz -lcrypt -lnsl -lm
chmod 755 blib/arch/auto/DBD/mysql/mysql.so
cp mysql.bs blib/arch/auto/DBD/mysql/mysql.bs
chmod 644 blib/arch/auto/DBD/mysql/mysql.bs
Manifying blib/man3/DBD::mysql.3
Manifying blib/man3/DBD::mysql::INSTALL.3
Manifying blib/man3/Mysql.3
Manifying blib/man3/Bundle::DBD::mysql.3
But then, when I got to 'make test', all hell broke loose.
[DBD-mysql-3.0002] 692 $ make test
PERL_DL_NONLAZY=1 /usr/local/bin/perl "-MExtUtils::Command::MM" "-e"
"test_harness(0, 'blib/lib', 'blib/arch')" t/*.t
t/00base.............ok
t/10dsnlist..........DBI connect('test','',...) failed: Access denied
for user 'jimk'@'localhost' (using password: NO) at t/10dsnlist.t line 45
Cannot connect: Access denied for user 'jimk'@'localhost' (using
password: NO)
Either your server is not up and running or you have no
permissions for acessing the DSN DBI:mysql:test.
This test requires a running server and write permissions.
Please make sure your server is running and you have
permissions, then retry.
t/10dsnlist..........dubious
Test returned status 10 (wstat 2560, 0xa00)
DIED. FAILED tests 1-9
Failed 9/9 tests, 0.00% okay
(I'll snip the rest of the tests because the same error message appeared
repeatedly.)
I thought perhaps the problem was that I was running as my own user
rather than root. But when I 'sudo'ed instead, I got the same failures,
only with 'root' substituted for 'jimk'.
[DBD-mysql-3.0002] 693 $ sudo make test
PERL_DL_NONLAZY=1 /usr/local/bin/perl "-MExtUtils::Command::MM" "-e"
"test_harness(0, 'blib/lib', 'blib/arch')" t/*.t
t/00base.............ok
t/10dsnlist..........DBI connect('test','',...) failed: Access denied
for user 'root'@'localhost' (using password: NO) at t/10dsnlist.t line 45
Cannot connect: Access denied for user 'root'@'localhost' (using
password: NO)
Either your server is not up and running or you have no
permissions for acessing the DSN DBI:mysql:test.
This test requires a running server and write permissions.
Please make sure your server is running and you have
permissions, then retry.
t/10dsnlist..........dubious
Test returned status 10 (wstat 2560, 0xa00)
DIED. FAILED tests 1-9
Failed 9/9 tests, 0.00% okay
The server is definitely running, but I'm at a loss as to how to
proceed, as 'make test' has failed both for 'jimk' and 'root'.
Suggestions? Thanks in advance.
Jim Keenan