FreeBSD MySQL does not support GBK and solutions

Source: Internet
Author: User

MySQL 5.1, installed with packages, does not support GBK encoding, only supports UTF8 encoding. Specific performance:

When you open a database encoded with GBK, you are prompted

ERROR 1273 (HY000): Unknown collation ' gbk_chinese_ci ' in table ' data_plus ' definition

Set names GBK and set character_set_client = GBK; Hint:

ERROR 1115 (42000): Unknown character set: ' GBK '

Finally have no way, had to use ports recompile.

Cd/usr/ports/databases/mysql51-server

Make WITH_CHARSET=GBK with_xcharset=all with_collation=gbk_chinese_ci build_static=yes Install clean

(In fact, when make install clean, there is a parameter hint, the first three set to be OK.) )

To view supported encodings:

Show VARIABLES like ' character_set_% ';

Show VARIABLES like ' collation_% ';

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.