garbled problems when inserting data into a database when the character set or query is data is not displayed correctly

Source: Internet
Author: User

Error when inserting data into database or out of the normal display when garbled. The first thing you should think about is the database coding problem. View the default character set for database processing by the current database server

Show variables like ' character_set% ';

character_set_client; The data format for the default client

character_set_connection; connection layer Character Set

character_set_database; current database Character Set

character_set_results; the server gives the external character set

If the client character set differs from the database server character set, it can be resolved by modifying the character format of the database server, such as Set_character_client = GBK.

The modification is at the session level when the restart is modified to expire (shortcut set server character set names GBK); Permanent modifications are required to be modified in the configuration file.

  

garbled problems when inserting data into a database when the character set or query is data is not displayed correctly

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.