Use one file per table with MySQL's INNODB storage engine

by Rekha 2010-01-28 14:29:53

By default MySQL's INNODB engine puts all the data for all the INNODB tables for all databases into the same file. This file will grow as it is used but will never shrink, even if you drop a very large INNODB table.

Change INNODB to use one file per table

* Stop the MySQL server (usually "/etc/init.d/mysql stop" on Linux).

* Edit the my.cnf file (located at somewhere like /etc/my.cnf or /etc/mysql/my.cnf)

* Add "innodb_file_per_table" on a single line by itself into the my.cnf file.

* Start the MySQLserver ("/etc/init.d/mysql start").

Any new INNODB tables that are created will now be created in the database's directory with a single file per database table. Doing this does not affect any existing INNODB tables; they will still use the common data file.

Tagged in:

1874
like
0
dislike
0
mail
flag

You must LOGIN to add comments