Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:

Sorry if I've posted this twice, but it doesn't seem to be appearing on the "seekers" page. Hi, I'm trying to run a script on cygwin, that I had origionally working on a unix server. I havent ported my sql database so I was going to connect to it from my new machine by using -
my $serverName = "www.server.com";
instead of -
my $serverName = "localhost"; Anyway, when I tried to run the script, I got -
perl index.cgi Prototype mismatch: sub main::head vs ($) at index.cgi line 9 <?xml version="1.0" encoding="utf-8"?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML Basic 1.0//EN" "http://www.w3.org/TR/xhtml-basic/xhtml-basic10.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" lang="en-US"><head><title>U +ntitled Document</title> </head><body>Content-Type: COmpile 1Content-type: text/html <H1>Software error:</H1> <PRE>install_driver(mysql) failed: Can't locate DBD/mysql.pm in @INC ( +@INC contains: ./ /usr/lib/perl5/5.6.1/cygwin-multi /usr/lib/perl5/5. +6.1 /usr/lib/perl5/site_perl/5.6.1/cygwin-multi /usr/lib/perl5/site_p +erl/5.6.1 /usr/lib/perl5/site_perl .) at (eval 10) line 3. Perhaps the DBD::mysql perl module hasn't been fully installed, or perhaps the capitalisation of 'mysql' isn't right. Available drivers: ExampleP, Proxy. at index.cgi line 34 </PRE> <P> For help, please send mail to this site's webmaster, giving this error + message and the time and date of the error. [Tue Mar 4 20:28:32 2003] index.cgi: install_driver(mysql) failed: Ca +n't locate DBD/mysql.pm in @INC (@INC contains: ./ /usr/lib/perl5/5.6 +.1/cygwin-multi /usr/lib/perl5/5.6.1 /usr/lib/perl5/site_perl/5.6.1/c +ygwin-multi /usr/lib/perl5/site_perl/5.6.1 /usr/lib/perl5/site_perl . +) at (eval 10) line 3. [Tue Mar 4 20:28:32 2003] index.cgi: Perhaps the DBD::mysql perl modu +le hasn't been fully installed, [Tue Mar 4 20:28:32 2003] index.cgi: or perhaps the capitalisation of + 'mysql' isn't right. [Tue Mar 4 20:28:32 2003] index.cgi: Available drivers: ExampleP, Pro +xy. [Tue Mar 4 20:28:32 2003] index.cgi: at index.cgi line 34 \[\033]0;\w\007 \033[32m\]\u@\h \[\033[33m\w\033[0m\] $
I then downloaded DBD-mysql-2.1026, but when I typed perl Makefile.pl I got -
Cant execute "mysql_config"
What should I do - THank you

Replies are listed 'Best First'.
Re: Mysql problem on Cygwin
by derby (Abbot) on Mar 04, 2003 at 22:46 UTC
    You need to install the mysql client "stuff" (very technical term there) first. That isn't part of the Cygwin set (I'm sure it used to be ... before RedHat started dating Postgres). You may have to google to find some pre-built binaries or just grab the source from mysql.com and compile it.

    -derby

      I downloaded cygwin-1.3.9-1.tar.bz2 from -
      http://rpmfind.net/linux/MySQL/cygwin/
      I then unzipped this in my /home/Administrator directory and the result was the creation of - a usr directory with bin, include, info, and a man directory. This is all in my Administrator directory. One of the created files was /cygwin/home/Administrator/usr/lib/automode.o. I did a search and I found that this file is also in my /cygwin/lib/ directory. Have I unzipped cygwin-1.3.9-1.tar.bz2 in the wrong place. I'm totally lost here guys, so sorry for the stupid question. Do I have to have mysql even if I'm only accessing a database on a remote server?
        Do I have to have mysql even if I'm only accessing a database on a remote server?

        Yes and no.

        MySQL comes in two parts: the actual database (the server stuff, also known as the backend), and the aforementioned <q>client stuff</q>, which provides an interface (a basic commandline interface, but also an API for other programs, I think). The client talks to the server either on the same system (localhost) or a different system.

        So you don't need the server-side MySQL daemon on your PC, but you do need the client portions.

        Have I unzipped cygwin-1.3.9-1.tar.bz2 in the wrong place.

        Maybe. Is there any documentation? Downloads the file and checks... Hmmm... despite the pathname in the URI, I don't see anything MySQL-related in that tarball. Looks like a (very stripped-down) cygwin root directory tree to me. Google turns up this and of course this, among other things.

        Also note that the MySQL server you are accessing has to be set up to allow you to access it remotely. Permissions in MySQL can be granted to a user only when connecting from a certain host (e.g., localhost).


        for(unpack("C*",'GGGG?GGGG?O__\?WccW?{GCw?Wcc{?Wcc~?Wcc{?~cc' .'W?')){$j=$_-63;++$a;for$p(0..7){$h[$p][$a]=$j%2;$j/=2}}for$ p(0..7){for$a(1..45){$_=($h[$p-1][$a])?'#':' ';print}print$/}

        Posted by jonadab. I'm having trouble with Perlmonks automagically logging me out tonight whenever I post, so if this comes out as anonymous... it's not my fault. There are messages in the sidebar as I write this that say I've got replies...