使用JPA/hibernate時若要讓預設資料庫的encoding為utf-8,並預設engine為innodb,則設定my.cnf在[mysqld]區段加上:
default-character-set=utf8default-collation=utf8_general_cidefault-storage-engine=innodb另外,Datasource JDBC url要加上
?characterEncoding=UTF-8&useUnicode=true&connectionCollation=utf8_general_ci&characterSetResults=utf8