Last active
August 29, 2015 14:06
-
-
Save josephsiefers/e7a30dff1ac2147f3fcc to your computer and use it in GitHub Desktop.
Transfer tables from one MySQL table to another
This file contains hidden or 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
#http://stackoverflow.com/questions/67093/how-do-i-quickly-rename-a-mysql-database-change-schema-name?page=1&tab=votes#tab-top | |
for table in `mysql -h $host -u root -P $port --password=$password -w -N -e "show tables from $schema"`; do | |
mysql -h $host -u root -P $port --password=$password -w -N -e "rename table $schema.$table to $schema_two.$table"; | |
done; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment