About MySQL database Chinese processing: Support UTF-8 setting method

Source: Internet
Author: User
For MySQL Chinese processing, it is best to adopt international standard UTF-8 character set. If garbled characters appear in the data table when saving Chinese characters, perform the following operations :【 Database EndSet and Development endSettings]

1. Development end:

Add utf8 to the connected URL:

JDBC: mysql: // localhost: 3306/[database name ]? Useunicode = true & amp; characterencoding = UTF-8

2, database: If you want the newly installed MySQL to support the UTF-8 character set by default, perform the following steps:

  • After installing MySQL, find the my. ini file and change all the relevant areas in the file to: default-character-set = utf8
  • Run the show variables like 'character _ SET _ % 'command in the MySQL Command window. The UTF-8-related content is as follows:
  •  
  • Run show variables like 'collation _ % '; you can also see the UTF-8-related content, as shown below:
  • Re-create database and table: Create Database [database name] Character Set utf8;

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.