Dave Perrett

InnoDB as Default MySQL Table Type

database, innodb, linux, mysql, programming, quickie

To change the default MySQL table type, edit your my.cnf file (usually /etc/mysql/my.cnf on ubuntu), and add the following line to the [mysqld] section :

1
 default-table-type=innodb

The resulting config will look something like this :

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
.....
[mysqld]
#
* * Basic Settings
#

#
* * IMPORTANT
*   If you make changes to these settings and your system uses apparmor, you may
*   also need to also adjust /etc/apparmor.d/usr.sbin.mysqld.
#

user        = mysql
pid-file    = /var/run/mysqld/mysqld.pid
socket      = /var/run/mysqld/mysqld.sock
port        = 3306
basedir     = /usr
datadir     = /var/lib/mysql
tmpdir      = /tmp
language    = /usr/share/mysql/english
skip-external-locking
default-character-set=utf8
skip-character-set-client-handshake
default-table-type=innodb
.....

You can also add the –default-table-type=innodb argument to mysqld on startup to achieve the same result.