#!/usr/bin/perl
use DBI;
use strict;
my $user = "";
my $password = "";
my $database = "";
my $dbh = DBI->connect("dbi:mysql:$database","$user","$password") || die "Can't connect to DB:";
my $sth = $dbh->table_info;
my @tables = @{$sth->fetchall_arrayref({})};
foreach my $table_info (@tables)
{ my $name = $table_info->{TABLE_NAME};
print $name,"\n";
$sth = $dbh->column_info(undef,$database,$name,'%');
my @info = @{$sth->fetchall_arrayref({})};
for my $field (@info)
{ print $field->{COLUMN_NAME}," = ",$field->{TYPE_NAME}, " : size ",$field->{COLUMN_SIZE},"\n"; }
print "-"x100,"\n";
}
$dbh->disconnect;
Dumping DB schemas (Score:1)
Re:Dumping DB schemas (Score:1)