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?
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 : https://stackoverflow.com/a/4056261/491757
http://dev.mysql.com/doc/refman/5.0/en/innodb-multiple-tablespaces.html:
And yes, a dump and restore is required to move existing tables into their own files.