can't install DBD::mysql - missing mysql.h?

From: Alex Hunsley (lardattardisdoteddotacdotuk_at_mailinator.com)
Date: 11/30/04


Date: Tue, 30 Nov 2004 15:39:36 +0000

I am trynig to access a MySQL database by using the DBI module under
perl. My code falls over with "Can't locate DBD/mysql.pm" so
I am trying to install the DBD::mysql module. However, it claims I need
mysql.h:

cpan> install DBD::mysql
CPAN: Storable loaded ok
Going to read /home/alex/.cpan/Metadata
   Database was generated on Mon, 29 Nov 2004 16:01:05 GMT
Running install for module DBD::mysql
Running make for R/RU/RUDY/DBD-mysql-2.9004.tar.gz
CPAN: Digest::MD5 loaded ok
CPAN: Compress::Zlib loaded ok
Checksum for
/home/alex/.cpan/sources/authors/id/R/RU/RUDY/DBD-mysql-2.9004.tar.gz ok
Scanning cache /home/alex/.cpan/build for sizes
DBD-mysql-2.9004/
DBD-mysql-2.9004/t/
DBD-mysql-2.9004/t/mysql2.t
DBD-mysql-2.9004/t/akmisc.t
DBD-mysql-2.9004/t/60leaks.t
DBD-mysql-2.9004/t/10dsnlist.t
DBD-mysql-2.9004/t/ak-dbd.t
DBD-mysql-2.9004/t/50chopblanks.t
DBD-mysql-2.9004/t/mysql.t
DBD-mysql-2.9004/t/lib.pl
DBD-mysql-2.9004/t/40blobs.t
DBD-mysql-2.9004/t/40nulls.t
DBD-mysql-2.9004/t/insertid.t
DBD-mysql-2.9004/t/40listfields.t
DBD-mysql-2.9004/t/40bindparam.t
DBD-mysql-2.9004/t/mysql.dbtest
DBD-mysql-2.9004/t/dbdadmin.t
DBD-mysql-2.9004/t/20createdrop.t
DBD-mysql-2.9004/t/00base.t
DBD-mysql-2.9004/t/30insertfetch.t
DBD-mysql-2.9004/t/40numrows.t
DBD-mysql-2.9004/t/50commit.t
DBD-mysql-2.9004/t/mysql.mtest
DBD-mysql-2.9004/MANIFEST
DBD-mysql-2.9004/myld
DBD-mysql-2.9004/dbdimp.c
DBD-mysql-2.9004/lib/
DBD-mysql-2.9004/lib/DBD/
DBD-mysql-2.9004/lib/DBD/mysql/
DBD-mysql-2.9004/lib/DBD/mysql/GetInfo.pm
DBD-mysql-2.9004/lib/DBD/mysql/INSTALL.pod
DBD-mysql-2.9004/lib/DBD/mysql.pm
DBD-mysql-2.9004/lib/Mysql/
DBD-mysql-2.9004/lib/Mysql/Statement.pm
DBD-mysql-2.9004/lib/Bundle/
DBD-mysql-2.9004/lib/Bundle/DBD/
DBD-mysql-2.9004/lib/Bundle/DBD/mysql.pm
DBD-mysql-2.9004/lib/Mysql.pm
DBD-mysql-2.9004/dbdimp.h
DBD-mysql-2.9004/mysql.xs
DBD-mysql-2.9004/MANIFEST.SKIP
DBD-mysql-2.9004/README
DBD-mysql-2.9004/INSTALL.html
DBD-mysql-2.9004/META.yml
DBD-mysql-2.9004/Makefile.PL
DBD-mysql-2.9004/ChangeLog
DBD-mysql-2.9004/constants.h
DBD-mysql-2.9004/TODO
Removing previously used /home/alex/.cpan/build/DBD-mysql-2.9004

   CPAN.pm: Going to build R/RU/RUDY/DBD-mysql-2.9004.tar.gz

Can't exec "mysql_config": No such file or directory at Makefile.PL line
174.
readline() on closed filehandle PIPE at Makefile.PL line 176.
Can't exec "mysql_config": No such file or directory at Makefile.PL line
174.
readline() on closed filehandle PIPE at Makefile.PL line 176.
Can't exec "mysql_config": No such file or directory at Makefile.PL line
174.
readline() on closed filehandle PIPE at Makefile.PL line 176.
Can't exec "mysql_config": No such file or directory at Makefile.PL line
174.
readline() on closed filehandle PIPE at Makefile.PL line 176.
Can't exec "mysql_config": No such file or directory at Makefile.PL line
174.
readline() on closed filehandle PIPE at Makefile.PL line 176.
Failed to determine directory of mysql.h. Use

   perl Makefile.PL --cflags=-I<dir>

to set this directory. For details see the INSTALL.html file,
section "C Compiler flags" or type

   perl Makefile.PL --help
Running make test
   Make had some problems, maybe interrupted? Won't test
Running make install
   Make had some problems, maybe interrupted? Won't install

So, the problem is "failed to determine directory of mysql.h". I've
found advice for this problem before that said download the client code
for mysql from mysql.org. I've done this and unpacked it (outside of
cygwin), but the same problem: I presume that I have to tell perl/cpan
installer about where mysql.h is somehow? I read somewhere that you add
the containing folder to the PATH variable, but this didn't help....

Of course, if there is an alternative module I could use rather than
DBD::mysql that is easy to install, I'd go with that! The bottom line is
that I just need to access a mySQL database from perl...

thanks!

alex



Relevant Pages

  • DBD:mysql driver
    ... to install the dbd from cpan I get this message: ... readline() on closed filehandle PIPE at Makefile.PL line 176. ... Can't exec "mysql_config": No such file or directory at Makefile.PL ...
    (perl.dbi.users)
  • Re: Installing Modules From CPAN
    ... cpan shell -- CPAN exploration and modules ... ReadLine support available (try 'install ... readline() on closed filehandle PIPE at Makefile.PL ...
    (perl.beginners)
  • How to make readline work in IRB?
    ... previously I could paste multiple lines of code to the irb prompt and irb ... I'm guessing the missing functionality comes from readline ... readline, and I didn't uninstall readline when I uninstalled Ruby 1.8.2, I ... I guess I'll go install it, ...
    (comp.lang.ruby)
  • Re: sarge to etch upgrade failed with unmet dependencies
    ... try running apt-get -f install for it to suggest a solution. ... >> played with the force option before with bad results. ... The following packages are in a mess due to serious problems during ... libmysqlclient15off mysql database client library ...
    (Debian-User)
  • Re: Problems with mySQL on FreeBSD
    ... I am trying to install phpBB ... > I logged in as root into the mysql database ... > I created a user called phpbbuser and allowed him access, from any host, ...
    (comp.unix.bsd.freebsd.misc)