Archive for September 3rd, 2008

Changing default storage engine in MySQL

Wednesday, September 3rd, 2008

This took me a while to figure out so I thought I’d put it here for future reference! I needed to change it so that Django would use innoDB rather that MyISAM, it seemed to just take the default and I couldn’t find an override.
You need to locate the mySQL config file (helpfully named) my.cnf file. On Centos 5.2 it is located at /etc/my.cnf
Then under the [mysqld] add the following line as shown below!

[mysqld]
default-storage_engine = innodb

Finally, restart mySQL;
$ service mysqld restart
It’s pretty easy to do when you know how and now you have transactional tables by default