#!/usr/bin/perl -w
#
# Write some info about the server and the client

$host = shift || "";

use Mysql;

$dbh = Mysql->Connect($host) or die "Can't connect to host: $host";

print "host:         ",$dbh->host,"\n";
if (defined($dbh->database))
{
  print "database:  ",$dbh->database,"\n";
}
print "hostinfo:     ",$dbh->get_host_info,"\n";
print "protoinfo:    ",$dbh->get_proto_info,"\n";
print "server:       ",$dbh->get_server_info,"\n";
print "client:       ",Mysql->get_client_info,"\n";
print "status:       ",$dbh->get_server_stats,"\n";

$Mysql::QUIET=1;
$dbh->Query("select 1+error");
$Mysql::QUIET=0;
print "Example of error message: ",$dbh->errmsg(),"\n";
print "Error number: ", $dbh->errno(),"\n";
