Incorrect characters in MYSQL table when writing or assigning values to a field

Source: Internet
Author: User
-When changing the value of the field, or write directly, the Chinese characters become garbled, "can pay attention to the database name, remember to modify"-when the character sequence is incompatible with Chinese characters, it may directly lead to garbled situations occur. It   is best to make the collation of the Library, table, field (character type) consistent--eg. a temporary table under a library does not specify a character collation, and when it is used downstream, the value of the Str field in the temporary table is assigned to another library table, possibly garbled-when the sort table is not specified The collation of the table is the collation of its library--1.  Library Level SELECT *--default_character_set_name  default_collation_name  concern column--  UTF8                        utf8_general_ci from Information_schema. ' schemata ' WHERE schema_name = ' addatacenter ';--2. Table Level SELECT *--table_collation  concern column--utf8_general_cifrom information_schema. ' TABLES ' twhere t. ' Table_schema ' = ' Addatacenter '--3. Field Level SELECT *--collation_name concern column--utf8_general_cifrom information_schema. ' COLUMNS ' as Cwhere c. ' Table_schema ' = ' AdDat Acenter '

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.