3 # small script to convert mysql tables to utf-8
7 # find Koha's Perl modules
8 # test carefully before changing this
10 eval { require "$FindBin::Bin/../../kohalib.pl" };
14 my $dbh=C4::Context->dbh();
16 my $database=C4::Context->config("database");
17 my $query="Show tables";
18 my $sth=$dbh->prepare($query);
20 while (my @table=$sth->fetchrow_array()){
21 print "Altering table $table[0]\n";
22 my $alter_query="ALTER TABLE $table[0] convert to CHARACTER SET UTF8 collate utf8_general_ci";
23 my $sth2=$dbh->prepare($alter_query);