MySQL culture issues

Source: Internet
Author: User

1) Chinese fuzzy search

 

2) Chinese Full Text Index

 

3) normal display of Chinese Characters in database tables

In fact, to display Chinese normally, there are the following methods:

N configuration parameters when MySQL is compiled: Configure -- With-charset = gb2312;

N Modify/etc/My. CNF: Set the character set, default-character-set = gb2312

N when creating a database table:

Creat databas mysqldata default Character Set gb2312 collate gb2312_chinese_ci

Run set names gb2312 before n query.

 

Faq1:SelectWhen a table is backed up, garbled characters may appear when there are Chinese data?

It should be that your word set is not set. Here are two ways to try:

1. Run set names gb2312 or GBK before "select * into OUTFILE 'backup.txt 'from TB.

2. Modify your my. CNF or my. ini and add them under [client] and [mysqld ].

Default-character-set = gb2312 or GBK, restart MySQL

 

Or you can use another backup method, such as mysqldump.

C:/program files/MySQL Server 5.0/bin> mysqldump-uroot-p -- default-charac

Ter-set = gb2312 -- opt test ck_2006_lu> C:/ck.txt

Where test is the database and ck_2006_lu is the table name.

 

Available for recovery

C:/program files/MySQL Server 5.0/bin> mysqldump-uroot-P

<C:/ck.txt

 

Faq2:GBKThe encoded text is written to the database and cannot be properly displayed?

Table character modification integration gb2312

Alter table Table1 Character Set gb2312 collate gb2312_chinese_ci;

 

 

Faq3: Is the search result incorrect when the search keyword contains Chinese characters?

 

 

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.