Posted on June 25, 2006 at 20:18 +0200
Tagged with mysql, ruby
Ever felt the need to batch-rename quite a few tables in a MySQL database? Sadly phpMyAdmin doesn't offer renaming of all the tables in a specific database. So I first started renaming them manually using the commandline interface but got soon quite tired of the whole process.
A quite ugly but IMO pragmatic workaround for this limitation is to build a small query file holding all the RENAME TABLE statements you want. To generate this query listing first of all get a list of all the tables you want to rename.
[more ...]