At 10:51 AM +0200 8/19/99, Philippe_PIERRE@stripped wrote:
>I'm really new in CGI programmation and in MySQL.
>Here are my configuration and my problem :
>I use Apache, Perl5 and MySQL for Win32.
>I installed DBI and the driver DBI:Mysql correctly.
>I have installed MySQL under
>...and my database is in the directory :
>with the files :
>I success in create my base and the daemon Mysqld apparently work fine.
>In other hand, I write a simple PERL script, which work under Apache, at
>... and the script start like this :
> use DBI;
> $base = "c:\mysql\data\Mybase";
> $DSN = "DBI:mySQL:$base";
> $user = "root";
> $pw = "";
> print "TITI";
> $dbh = DBI->connect($DSN,$user,$pw) || die "Cannot connect:
>$DBI::errstr\n" unless $dbh;
> print "TOTO";
Your script has a few problems:
- $base should be just the name of your database "Mybase", not the pathname
to it on the server host.
- $DSN should have "mysql", not "mySQL" (the capitalization matters)
- Your connect() call is a little odd. It has an extra conditional. I'd
write it like this:
$dbh = DBI->connect($DSN,$user,$pw)
die "Cannot connect: $DBI::errstr\n";
You don't need the extra "unless $dbh" part.
>TITI is printed on the screen but not TOTO, so i can't connect to my base !
>Actually, i don't understand how works the link beetween the MySQL base and
>the script. How does it connect to the base ?
Not sure what you mean here.
Paul DuBois, paul@stripped