Ik geloof dat je een script moet schrijven in de taal die je het leukst vindt. Je kunt een lijst van de tabellen in het schema krijgen van de information_schema db, ze dan herhalen en alle tabellen afkappen waar je zin in hebt.
Zoekopdracht zou zoiets zijn als:
SELECT table_name FROM information_schema.tables WHERE table_schema = 'test' AND table_name NOT IN ('table1', 'table2');
Bewerken :Hier is een voorbeeld waarin Perl wordt gebruikt:
use strict;
use warnings;
use DBI;
my $dbh = DBI->connect("some_dsn");
my $sth = $dbh->prepare(q{SELECT table_name FROM information_schema.tables WHERE table_schema = 'test' AND table_name NOT IN ('table1', 'table2')});
$sth->execute();
$sth->bind_columns(\my $table_name);
while($sth->fetch) { $dbh->do(q{TRUNCATE TABLE } . $table_name) }