use DBI; use DBD::Backup; my $dsn = "DBI:mysql:database=$datenbank;host=$db_host;port=$db_port"; my $dbh = DBI::->connect( $dsn, $db_user, $db_pw, { RaiseError => 1, PrintError => 0, AutoCommit => 1, mysql_enable_utf8 => 1 } ); my $mb = new_from_DBH DBD::Backup($dbh,{'USE_REPLACE' => 1, 'SHOW_TABLE_NAMES' => 1}); open (AUSGABE, ">sicherung.sql"); print AUSGABE "DROP TABLE IF EXISTS `Test`;\n"; print AUSGABE $mb->table_desc('Test'); print AUSGABE $mb->table_data('Test'); print AUSGABE "DROP TABLE IF EXISTS `Test2`;\n"; print AUSGABE $mb->table_desc('Test2'); print AUSGABE $mb->table_data('Test2'); close (AUSGABE);