Changing default storage engine in MySQL
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 ![]()

October 1st, 2008 at 11:06 am
Thanks Dougal - this was just the quick answer I needed. However, I believe it should be “default-storage-engine” instead of “default-storage_engine”. Note the underscore.
October 1st, 2008 at 1:55 pm
Interesting. I will check when I’m home but I’m almost 100% sure I’ve got default-storage_engine in my config.
Did you do it your way and it worked? Maybe it can be either?
November 9th, 2008 at 5:03 pm
Thank you very much for this post. I’ve been searching a long time for this.