Garbled when eclipse inserts data into MySQL

Source: Internet
Author: User
Tags change settings dedicated server

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

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.