1.编辑/etc/my.cnf ,在[mysql]段加入default_character_set=utf8
2.在编写Connection URL时,加上?useUnicode=true&characterEncoding=utf-8参数