Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'm walking into an environment that uses MySQL and Innodb as the storage engine. I'd like to enable innodb_file_per_table to increase performance. Considering all of the databases/tables are currently stored in ibdata1/default ibdata file will the innodb_file_per_table option only affect new tables created after I set this directive?

What would be the best way to take the existing database and split each table into it's own ibd file? Would I have to dump/recover all of the tables to make this happen?

share|improve this question
up vote 1 down vote accepted

The --innodb_file_per_table option affects only table creation, not access to 
existing tables. If you start the server with this option, new tables are 
created using .ibd  files, but you can still access tables that exist in the 
shared tablespace. If you start the server without this option, new tables are 
created in the shared tablespace, but you can still access any tables that were
created using multiple tablespaces.

And yes, a dump and restore is required to move existing tables into their own files.

share|improve this answer
Thanks for the reference. What would be the recommended procedure to dump/restore as individual .ibd files? Should I dump the entire database, set the innodb_file_per_table, restart mysqld, then restore the database? Or would I have to dump/restore tables individually? Thanks again for your help. – geekweapon May 19 '13 at 23:02
Dump all Databases, drop all Databases (except "mysql"), stop MySQL, adjust my.cnf, remove ibdata1/ib_logfile* files (careful! This assumes you want to move all InnoDB DBs to file_per_table style!), start MySQL, import the dump – faker May 19 '13 at 23:06

I agree with @faker's answer's and comments (+1 for his answer), but there is still one major thing to do:

Before you shutdown mysql, you need to run SET GLOBAL innodb_fast_shutdown = 0;. Why?

This will completely purge all transactional information left over in ib_logfile0 and ib_logfile1. The shutdown time is longer, but nothing in terms of transactional data that is uncommitted with linger. Thus, there will be no data lost doing this process.

Here is my post in StackOverflow how to do it :

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.