#!/usr/bin/perl
use DBI;
use Switch;

my $db_name="DB";
	my $location="192.168.0.208";
	my $port="3306";
	my $db_user="zoe";
	my $db_pass='123'; 
	#帐号密码要注意有特殊符号时用的引号类型


	#获取驱动程序对象句柄
my $drh=DBI->install_driver("mysql"); 
#如果存在数据库$db_name,则删除之
#$if($rc = $drh->func("dropdb",$db_name ,$location,$db_user,$db_pass,"admin") ){ 
  #  print "drop database `",$db_name,"` successfully!\n";
#}
#创建数据库$db_name
$rc = $drh->func("createdb",$db_name ,$location,$db_user,$db_pass,"admin")or
    die "failed to create database ",$db_name,"!\n";
print "create database `stucourse` successfully!\n";