rioba:
I’m testing Servoy with a MySQL 5 database. Until now I have used the Sybase db included with the Servoy distribution.
Everything seems to work fine, except that I am not able to create InnoDB tables using Servoy. I understand that InnoDB tables are needed for transaction support.
I have set the default tables for MySQL to InnoDB. Nicola Gervasi, in his Mini-HowTo just published by Servoy Magazine, confirms that this should be done when configuring MySQL and Servoy.
The problem is that, if I try to create a table from within Servoy, the table type is always set to MyISAM, even if the default in MySQL is siet to InnoDB. Servoy forces the MyISAM table. This is the schema used by Servoy for a table of the repository db
CREATE TABLE `servoy_clients` (
client_id
varchar(50) NOT NULL,
user_id
int(11) default NULL,
PRIMARY KEY (client_id
)
) ENGINE=MyISAM DEFAULT CHARSET=latin1
I understand that I could create all tables in MySQL and then use them in Servoy, but this is not practical and I am not sure that the conversion between the Servoy data types and those of MySQL will be correct.
Any suggestions?
Try to see what happens if you create a table from mysql client without specifiyng the engine, like this:
CREATE TABLE `test` (`test_id` varchar(50) NOT NULL, PRIMARY KEY (`test_id`))
After that check if the table is using InnoDB with this query: “show create table test;”, the output should be like this:
| test | CREATE TABLE `test` (
`test_id` varchar(50) NOT NULL default '',
PRIMARY KEY (`test_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8
If it’s using MyISAM there is a config problem (as I suspect), double check your /etc/my.cnf file, check if mysql is really reading this file or if it is reading some other my.cnf file (you can have a server wide config, a specific daemon config, etc. depending on the file position on the filesystem, RTM).
In the my.cnf file be sure to have added the “default-storage-engine=innodb” to the [mysqld] section, if it is added to other sections it doesn’t work and while you’re at it add the line “default-character-set=utf8” to use UTF for the default encoding (from your post I’ve seen you are using latin1). Be sure to have turned on “bin-log” otherwise InnoDB could not work (you can find istructions in my tutorial). Restart mysqld to apply all mods done to my.cnf and check the logs.
When everything works as expected drop all the tables in the servoy repository database and start servoy to recreate them and see what happens.