Character set problems encountered in MYSQL5 and their solutions

Source: Internet
Author: User
Tags character set mysql client mysql version linux

Open the Slave log today and find a bunch of bugs all of this:

[ERROR] Slave:error ' Character set ' #28 ' is not a compiled Character set and isn't specified in '/usr/local/mysql/share/mysq L/charsets/index.xml ' file ' on query.

I wrote the INSERT statement on the Master (Linux) machine and found that synchronization was OK, and then I inserted the data on the window with a MySQL client, and the problem started appearing. View slave log discovery via Mysqlbinlog

If you insert data by using GBK-encoded clients, you have the following log:

SET @ @session. character_set_client=28,@ @session. collation_connection=33,@ @session. collation_server=8/*!*/;

If you are writing inserts directly on Linux, the above GBK becomes 8 (latin-swde)

The reason should be that the MySQL client uses GBK encoding and the server is unrecognized. Although you can find GBK in '/usr/local/mysql/share/mysql/charsets/index.xml ', but by showing CHARACTER SET, you can see that the database does not list GBK.

I compared the MySQL version on other machines, found that the MySQL on those machines are used by the release version, and this slave machine using the source code installed, so I made a mysql-5.0.37-linux-i686-glibc23.tar.gz

And then

Cd/usr/local

MV MySQL Mysql-old

Tar xzvf mysql-5.0.37-linux-i686-glibc23.tar.gz

MV Mysql-5.0.37-linux-i686-glibc23 MySQL

Start MySQL, everything's OK.

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.