"MySQL-20180117" MySQL terminal cannot input Chinese

Source: Internet
Author: User

Most of the internet is MySQL terminal input in Chinese garbled, and then change the character set of MySQL server operation, but the lack of MySQL terminal cannot input Chinese, copy the SQL statement copied to MySQL terminal Chinese cannot display:

Alter qsjx_recommend add column ' article_type ' tinyint not NULL DEFAULT 1 COMMENT ' 1 featured, 2 preferably ';

Problem thinking: In this case it is generally associated with the setting of the character set, but it should be considered whether the character set is related to the MySQL client character set or the MySQL server side character set.

    1. MySQL client Specifies the character set when connecting to the database:

Mysql-uroot-p--default-character-set UTF8

2. MySQL Server local Character set information:

According to the idea of the test, found that the MySQL terminal can not input Chinese, paste copied Chinese words can not be displayed.

Finally in a netizen's thinking solved my problem:

In the above it is very clear that the terminal Chinese data does not involve the server side, and the MySQL character set does not have any relationship. This time I get my own local user environment variables:

Obviously, my local user's lang=c. To modify the character set of a local user:

Export Lang=en_us. UTF-8

Final Result:

"MySQL-20180117" MySQL terminal cannot input Chinese

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.