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.
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