MySQL inserted Chinese record garbled

Source: Internet
Author: User

1, modify the configuration file My.ini Set encoding method is Utf-8

[Client] default-character-set=UTF8 [mysqld]character-set-server=UTF8 collation -server=utf8_general_ci init_connect= ' SET NAMES utf8′

Restart MySQL, and then enter it at the command line:

Show varables like "%char%"

Setup is complete!

2. An error occurred while inserting Chinese records

366 string ' \xe8\xbd\xa6\xe9\x9b\xb6 ... '  for ' name ' 1

Then you have to delete the originally built DB, re-build and develop the character set as UTF8, such as:

CREATE DATABASE ' jay_db ' DEFAULT CHARACTER SET UTF8 COLLATE utf8_general_ci;

3. Correct Chinese record display

Reference:

Http://www.tuicool.com/articles/YvEZjyU

Http://www.kuqin.com/database/20090406/44388.html

MySQL inserted Chinese record garbled

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.