Hello,

I have written the program below and I have gotten it to compile and
run.  However, it continually tells me that mysql server does not appear
to be running.  I originally wrote this out of the MySQL book just to
test the DBI module and make sure everything would compile.  Now, I just
want to make sure I can at least connect with the database.  Does anyone
see any problem by glancing over the code?  I have tried
$server='66.33.34.146' actual IP address of the server, and I have tried
$server='';

Any help would be appreciated.

Thanks.

#!/usr/bin/perl -w
use strict;
use CGI qw(:standard);
use CGI::Carp;
use DBI;
CGI::use_named_parameters(1);
my ($server, $sock, $host);
my $output = new CGI;
$server = '';
my $driver = DBI->install_driver('mysql');
my @databases = $driver->func($server, '_ListDBs');
if (not @databases) {
print header, start_html('title'=>"Information on
$server",'BGCOLOR'=>'white');
print <<END_OF_HTML;
<H1>$server</h1>
$server does not appear to have a running mySQL server.
</body></html>
END_OF_HTML
exit(0);
}
print header,start_html('title'=>"Information on
$host",'BGCOLOR'=>'white');
print <<END_OF_HTML;
<h1>$host</h1>
<p>
$host\'s connection is on socket $sock.
<p>
Databases:<br>
<UL>
END_OF_HTML
foreach (@databases) {
  print "<LI>$_\n";
}
print <<END_OF_HTML;
</ul>
</body></html>
END_OF_HTML
exit(0)


---------------------------------------------------------------------
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/           (the list archive)

To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php

Reply via email to