perl DBI

#!/usr/bin/perl

use DBI;
$db=
DBI->connect('DBI:mysql:test;user=root;password=1q2w3e');

$sth=$db->prepare("SELECT * FROM test")
or die "Can't prepare sql statement". DBI->errstr;

$sth->execute();
print qq(\n\tContents of "test" table\n);

$sth->dump_results();

$sth->finish();

$db->disconnect();

 

你可能感兴趣的:(sql,mysql,qq,perl)