Task: move a table from one database to another in MySQL. For example, you created a table in the wrong database and, for whatever reason, don't want to recreate it.
The MySQL RENAME TABLE command will help us here:
RENAME TABLE database1.mytable TO database2.mytable
This moves the table from the database1 database to database2.
Applies to: MySQL 5+
Comments