roaned roaned - 7 months ago 48
SQL Question

OpenShift add cartridge MySQL 5.5 engine InnoDB



when i do

 
rhc cartridge add mysql-5.5 --app NameApp
the engine default of DB is MyISAM. But if i need engine InnoDB, how can i create db on OpenShift?

Tim Tim
Answer

The default storage engine for mysql is set with an environment variable. Add the cartridge, then run the below to use InnoDB:

$ rhc env add OPENSHIFT_MYSQL_DEFAULT_STORAGE_ENGINE=InnoDB -a NameApp
$ rhc app-restart NameApp

See the mysql cartridge configuration where this is set:

https://github.com/openshift/origin-server/blob/master/cartridges/openshift-origin-cartridge-mysql/conf/my.cnf.erb#L39

Comments