Mysql – Where should I look for the.cnf

innodbMySQL

I want to add innodb_file_per_table statement to my.cnf file.

Where is my.cnf?

Could I change this file when I have an online site?

Best Answer

Once you add it to my.cnf (wherever it is), make sure you add it as follows:

[mysqld]
innodb_file_per_table

A mysql restart is required to implement this for all new InnoDB tables. Doing this does not make all the InnoDB tables jump out of ibdata1.

You can cleanup InnoDB so that all tables and their indexes reside in separate tablespace files.

You will also need to tune the InnoDB parameters.

There needs to be some downtime to do this cleanup. Once done, you never have to go about doing it again.

For now, if you want to do it to a live site, you must run this:

mysql> SET GLOBAL innodb_file_per_table = 1;