Decompression version of Chinese garbled problem MySQL Chinese garbled

Source: Internet
Author: User

Installed is the decompression version of MySQL, specific configuration reference: Https://jingyan.baidu.com/article/9c69d48f85032f13c9024e15.html.

1: Unzip and then copy a My.ini file and add the byte encoding configuration:

[Client]default-character-set=gbk[mysqld]character-set-server=utf8

Specify the database configuration file bin\mysqld--defaults-file=my.ini--initialize-insecure Specify the configuration file My.ini (if this step is omitted, the configuration My.ini will not take effect, a little pit)

Installation database: Bin/mysqld--install

Start the database service: net start MySQL (in Windows environment)

2: Specify the database encoding when creating the database:

3 Specify UTF8 encoding when creating a table:

CREATE TABLE ' demo_table ' (  ' name ' varchar (255) NOT NULL,  ' created_at ' timestamp not null DEFAULT Current_timesta MP,  ' modified_at ' timestamp not NULL DEFAULT ' 0000-00-00 00:00:00 ' on UPDATE current_timestamp,  ' Size ' bigint (20 Default NULL,  ' type ' varchar (255)  default NULL,  ' label ' varchar (255)  default NULL,  PRIMARY KEY ( ' Name ', ' created_by ') Engine=innodb DEFAULT Charset=utf8;

  

Decompression version of Chinese garbled problem MySQL Chinese garbled

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.