In fact, to solve this problem is to ensure that the entire data insertion process to match the character encoding. There are three things to be aware of,
The first is the Msyl database, is to ensure that the MySQL database and the table to ensure that the code is consistent, for example, are UTF-8,
The second is that the eclipse side also has to ensure that the project, workspace and Java file Encoding format is also UTF-8,
The third is that the configuration file inside the JDBC URL (Jdbc:mysql://localhost:3306/mybatis?characterencoding=utf8) is also set after the encoding (this problem was not encountered before, This time garbled and finally found it was his sake)
For everyone said to change what My.ini configuration file, this I did not go to modify, with the default text of MySQL, as shown in
# for advice The change settings
# http://dev.mysql.com/doc/refman/5.6/en/server-configuration-defaults.html
# * * * Don't EDIT this FILE. It ' s a template which'll be copied to the
# * * * default location during install, and would be replaced if you
# * * * * Upgrade to a newer version of MySQL.
[Mysqld]
# Remove Leading # and set to the amount of RAM for the most important data
# Cache in MySQL. Start at 70% of all RAM for dedicated server, else 10%.
# innodb_buffer_pool_size = 128M
# Remove Leading # to turn on a very important data integrity option:logging
# Changes to the binary log between backups.
# Log_bin
# These is commonly set, remove the # and set as required.
# Basedir = ...
# DataDir = ...
# port = .....
# server_id = ...
# Remove Leading # To set options mainly useful for reporting servers.
# The server defaults is faster for transactions and fast selects.
# Adjust sizes as needed, experiment to find the optimal values.
# join_buffer_size = 128M
# sort_buffer_size = 2M
# read_rnd_buffer_size = 2M
Sql_mode=no_engine_substitution,strict_trans_tables
Garbled when eclipse inserts data into MySQL