MySQL defaults for the 21st century
A minor annoyance when using MySQL with Hibernate is that, unless you say otherwise, everything defaults to Latin1 and MyISAM. This isn’t an ideal setup for most of us.
Until recently, I assumed that since Databinder’s examples are served in UTF-8, they were capable of accepting and storing any input. Once upon a time this seemed to be true in PHP (don’t ask); UTF-8 would go into the tables and come out intact even if the tables thought they were in a Latin character set. But for whatever reason (probably the connection character set), high characters in the Databinder examples were yielding the dreaded ’?’.
There are other ways to ensure that your connection, database, and tables are all in UTF-8, but my favorite is to change the defaults for MySQL so I can just forget about it forever. Oddly, I really had to dig to come up with these lines for my.cnf:
[mysqld] default-character-set=utf8 default-table-type=InnoDB
There’s more info (and a caveat) in Databinder’s workspace optimization tips.
Add a comment