ibdata1 innodb_file_per_table
Par PlaceOweb le dimanche, janvier 12 2014, 10:39 - SQL - Lien permanent
MySQL InnoDB ibdata1 innodb_file_per_table
InnoDB
- 5.0 : Le moteur de tables InnoDB
- 5.1 : The InnoDB Storage Engine
- 5.5 : The InnoDB Storage Engine
- 5.6 : The InnoDB Storage Engine
- 5.7 : The InnoDB Storage Engine
Ressources "bdata1 innodb_file_per_table"
ibdata1 grows exponentially when innodb_file_per_table is configured
Procedure:
- Dump All DB's
- Stop MySQL
- Add "innodb_file_per_table"
- Delete all ib* file
- Start MySQL
- Import All DB's
Can I safely switch to Innodb file-per-table and delete ibdata1?
According to the documentation : Using Per-Table Tablespaces : Enabling and Disabling Multiple Tablespaces
With multiple tablespaces enabled, InnoDB stores each newly created table in its own tbl_name.ibd file in the appropriate database directory. Unlike the MyISAM storage engine, with its separate tbl_name.MYD and tbl_name.MYI files for indexes and data, InnoDB stores the data and the indexes together in a single .ibd file. The tbl_name.frm file is still created as usual.
If you remove the innodb_file_per_table line from my.cnf and restart the server, InnoDB creates any new tables inside the shared tablespace files.
You can always access both tables in the system tablespace and tables in their own tablespaces, regardless of the file-per-table setting.
The answer to your question: NO, you can't delete ibdata1, ib_logfile0 or ib_logfile1, because just enabling the option does NOT move your existing data.