zabbix:/root/sbin# perl t1.pl 20160101 20160105
create table test1.test_20160101;
create table test1.test_20160102;
create table test1.test_20160103;
create table test1.test_20160104;
create table test1.test_20160105;
create table test2.test_20160101;
create table test2.test_20160102;
create table test2.test_20160103;
create table test2.test_20160104;
create table test2.test_20160105;
create table test3.test_20160101;
create table test3.test_20160102;
create table test3.test_20160103;
create table test3.test_20160104;
create table test3.test_20160105;
zabbix:/root/sbin# cat t1.pl
use DBI;
use HTTP::Date qw(time2iso str2time time2iso time2isoz);
my $ip="127.0.0.1";
my $user="root";
my $passwd="1234567";
my $dbh = DBI->connect("dbi:mysql:database=$message;host=$ip;port=3306",$user,$passwd) or die "can't connect to database ". DBI-errstr;
##防止utf-8中文乱码
$dbh->do("SET NAMES u
perl 通过生成mysql 批量sql
最新推荐文章于 2021-04-07 04:10:03 发布