Simple script to move all tables from one database to another. Please don't use this in production as it could fail horribly. Also, RENAME table doesn't work on views, so they won't be migrated.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
|TABLES=`echo "SHOW TABLES IN $1;" | mysql -NB`|
|for TABLE in $TABLES; do|
|$(echo "RENAME TABLE \`$1\`.\`$TABLE\` TO \`$2\`.\`$TABLE\`;" | mysql)|