Commits

Zhang Huangbin committed 31625dc

Enable 'innodb_file_per_table' in MySQL by default.

Comments (0)

Files changed (3)

iRedMail/ChangeLog

 iRedMail-0.8.6:
+    * Enable 'innodb_file_per_table' in MySQL by default.
     * Enable Opportunistic TLS support in Postfix when sending mail to remote
       SMTP server (smtp_tls_security_level=may).
       Thanks kotso <admin _at_ co.ge> and vlastikcz for the report.

iRedMail/functions/mysql.sh

     # Disable 'skip-networking' in my.cnf.
     perl -pi -e 's#^(skip-networking.*)#${1}#' ${MYSQL_MY_CNF} &>/dev/null
 
+    # Enable innodb_file_per_table by default.
+    grep '^innodb_file_per_table' ${MYSQL_MY_CNF} &>/dev/null
+    if [ X"$?" != X'0' ]; then
+        perl -pi -e 's#^(\[mysqld\])#${1}\ninnodb_file_per_table#' ${MYSQL_MY_CNF}
+    fi
+
     ${MYSQLD_RC_SCRIPT} restart &>/dev/null
 
     ECHO_DEBUG "Sleep 5 seconds for MySQL daemon initialize ..."

iRedMail/samples/my.cnf

 #
 #innodb_buffer_pool_size=512M
 
+# Creates each new table using its own .ibd file for storing data and indexes,
+# rather than in the system tablespace (ibdata*).
+# Reference:
+# http://dev.mysql.com/doc/refman/5.5/en/innodb-parameters.html#sysvar_innodb_file_per_table
+innodb_file_per_table
+
 #ssl-ca =
 #ssl-cert =
 #ssl-key =