How move MySql table to another disk? According to this it is impossible to use alter table for moving tables. So if I understand correctlly - to move table it is neccessary to do:


Create new table
Copy all row from old one
drop old table
Rename new table created.


First of all - it these steps are correct?
Second - is there more beautiful way to this operation?
SHOW CREATE TABLE real;  -- to avoid typos
edit it change name to new and to add DATA_DIRECTORY= ... or whatever
perform the CREATE TABLE new ...
INSERT INTO new SELECT * FROM real; -- single, fast, step.  But not instantaneous
RENAME TABLE real TO old, new TO real;
DROP TABLE old;


Step 5 is the main added "elegance".  It is atomic and instantaneous; it won't interrupt the live system.  Also, it give you a chance to test the new real before DROP TABLE old.

If this is InnoDB, you must have innodb_file_per_table ON before step 3.  Was it ON when the old real was created?  If not, ibdata1 will not free up any space on the old disk.  Resolving this takes several more steps.

(My steps should work fine for a MyISAM table.)