MySQL Forums
Forum List  »  InnoDB

Re: how to change storage location of a table?
Posted by: Rick James
Date: September 06, 2015 02:40PM

This might work:

SET innodb_file_per_table = ON;

CREATE TABLE new (
...
) ENGINE=InnoDB, DATA_DIRECTORY=..., INDEX_DIRECTORY=...;

INSERT INTO new SELECT * FROM real;

RENAME TABLE real TO old, new TO real;

DROP TABLE old;

Since the Data and Indexes are in the same .ibd file, I don't know if you need to specify both.

Options: ReplyQuote


Subject
Views
Written By
Posted
1770
September 05, 2015 03:06PM
Re: how to change storage location of a table?
992
September 06, 2015 02:40PM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.