After reloading the database, the item appears garbled in Chinese

Source: Internet
Author: User

Garbled problem, the fundamental reason is that the code is not unified, since the reload database, the project is no Chinese garbled, so the problem must appear in the database code.

After running MySQL, enter the following command

Show variables like ' character% ';

The author's query results are as follows:


Among them, character_set_client client coding mode;
Character_set_connection the encoding used to establish the connection;
Coding of character_set_database database;
Character_set_results the result set encoding;
Character_set_server the database server code;

As long as the above four to ensure that the same encoding, there will be no garbled problem. It can be seen that the author's database will appear coding problems. The solution is also simple, and add this to the database connection profile for each project.

Jdbc:mysql://localhost:3306/databasename?useunicode=true&characterencoding=utf-8
Or
Jdbc:mysql://localhost:3306/databasename?useunicode=true&characterencoding=utf-8
You can choose one of them based on different XML parsing tools.



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.