#!/usr/bin/perl
use encoding "utf-8";
use DBI;
$dbname="XXXX";
$user="XXXX";
$passwd="XXXX";
$dbh = DBI->connect("dbi:mysql:database=$dbname;host=127.0.0.1;port=3306",$user,$passwd) or die "can't connect to database ". DBI-errstr;
$dbh->do("SET NAMES utf8");
$sth=$dbh->prepare("select * from STUDENT");
$sth->execute;
while (@recs=$sth->fetchrow_array) {
print $recs[0].":".$recs[1].":".$recs[2]."\n";
}
$dbh->disconnect;