Change table's database

AntonioCS posted 9 years ago in General
Is there no option to change a table via the gui to another database? I tried drag and drop but it just won't work :(
ansgar posted 9 years ago
You cannot move it, but copy it. Just rightclick the table in "Database" tab, and click "Create table copy" from the context menu.
rosenfield posted 9 years ago
You can also move a table manually with the following SQL command:

ALTER TABLE `from_db`.`table1` RENAME TO `to_db`.`table1`;

A drag-n-drop solution would be harmful to more people than it would help: the underlying ALTER TABLE operations usually work by creating a new table and then dumping the old one, consuming significant resources. Accidental drag/drops are commonplace, and each one would result in tables being locked and massive server resources being used, plus the risk of the operation failing.

Please login to leave a reply, or register at first.