Change table's database

[expired user #3438]'s profile image [expired user #3438] posted 16 years ago in General Permalink
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's profile image ansgar posted 16 years ago Permalink
You cannot move it, but copy it. Just rightclick the table in "Database" tab, and click "Create table copy" from the context menu.
[expired user #1125]'s profile image [expired user #1125] posted 16 years ago Permalink
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.