The default encoding (character_set_server) of mysql is latin1.
When creating a DB, if no encoding is specified, the encoding of the DB is the same as that of character_set_server.
When creating a Table, if no encoding is specified, the encoding of the Table is the same as the encoding of the DB.
When creating a Column, if no encoding is specified, the encoding of the Column is the same as the encoding of the Table.
For MySQL versions greater than or equal to 4.1.0, by setting character-set-server, jdbc will automatically detect this encoding.
[mysqld]
character-set-server = utf8
If you don't want to use automatic detection, you can specify the encoding in the link
jdbc:mysql://localhost:3306/database?useUnicode=true&characterEncoding=UTF-8
https://dev.mysql.com/doc/connector-j/5.1/en/connector-j-reference-charsets.html