Solved

installing Perl's DBD-mysql module on Cygwin

Posted on 2004-09-09
4
585 Views
Last Modified: 2008-02-01
I downloaded the DBD-mysql-2.9004 module from CPAN and am attempting to install it so that my Perl scripts running in the Cygwin environment can access an Mysql database. However, here's the output of my attempt to generate a Makefile, by having Perl interpret Makefile.PL:
~/mg/DBD-mysql-2.9004# perl Makefile.PL --cflags=-I/cygdrive/c/mysql/include
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 libmysqlclient.a|libmysqlclient.so. Use

  perl Makefile.PL "--libs=-L<dir> -lmysqlclient"

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

  perl Makefile.PL --help
~/mg/DBD-mysql-2.9004#


The trouble is that I don't have any files on my hard drive named libmysqlclient.a or libmysqlclient.so. Any idea of how I can get solve or get around this?

Thanks.
0
Comment
Question by:bobwood2000
  • 3
4 Comments
 
LVL 26

Accepted Solution

by:
ushastry earned 250 total points
ID: 12023909
Hi,

To install the DBI and DBD::mysql modules on a Unix-like OS or Perl on Windows installed as part of Cygwin, run the following commands.

Note that you must have MySQL already installed or you will not be able to install the DBD::mysql module. Also, if you haven’t installed any other modules this way, you’ll be asked for configuration options. Luckily, these are self-explanatory. Once you've finished entering the configuration values, the module installation will start.

perl –MCPAN –e 'install DBI'
perl –MCPAN –e 'install DBD::mysql'
You'll see several screens of text fly by, but eventually it should return you to the friendly command prompt.

take a look at fo more..

http://search.cpan.org/~jwied/DBD-mysql-2.1026/lib/DBD/mysql/INSTALL.pod
0
 

Author Comment

by:bobwood2000
ID: 12029871
"perl –MCPAN –e 'install DBD::mysql' " gives me error messages, likely because CPAN isn't configured correctly. I think the problem is that my home directory has a space between my first and last name. CPAN doesn't seem to be able to deal with this. For example, the path should be /home/Robert Wood. CPAN prints: cannot open /home/Robert: no such file. I've tried changing where it stores files, but 'o conf' doesn't seem to make the right changes. Any advice?

Thanks.
0
 

Author Comment

by:bobwood2000
ID: 12036350
Okay, I got CPAN(Plus) working. Install DBD::mysql via CPANPLUS gives me the same errors as when I was installing DBD::mysql manually.
0
 

Author Comment

by:bobwood2000
ID: 12036372
I found the solution to this problem:

http://search.cpan.org/src/RUDY/DBD-mysql-2.9004/INSTALL.html#windows/cygwin

Amazingly, installing the DBD::mysql requires compiling MySQL within the Cygwin environment. It's crazy enough to work, and is probably the only way to do it.

Moderators: Please refund my points, but leave up this solution in case any one is searching for the same error messages I had. Thanks.
0

Featured Post

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Question has a verified solution.

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

Introduction In this installment of my SQL tidbits, I will be looking at parsing Extensible Markup Language (XML) directly passed as string parameters to MySQL 5.1.5 or higher. These would be instances where LOAD_FILE (http://dev.mysql.com/doc/refm…
Foreword This is an old article.  Instead of using the MySQL extension that was used in the original code examples, please choose one of the currently supported database extensions instead.  More information is available here: MySQLi / PDO (http://…
This Micro Tutorial demonstrates using Microsoft Excel pivot tables, how to reverse engineer competitors' marketing strategies through backlinks.
Both in life and business – not all partnerships are created equal. As the demand for cloud services increases, so do the number of self-proclaimed cloud partners. Asking the right questions up front in the partnership, will enable both parties …

863 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

22 Experts available now in Live!

Get 1:1 Help Now