Troubleshooting of MySQL command line garbled

Source: Internet
Author: User
Tags mysql command line


The MySQL command line garbled solves the problem. Using the MySQL command line can implement many features we need, but when using the MySQL command line, one problem is that garbled characters or errors occur when you insert Chinese data or query Chinese data in the MySQL command line. On the MySQL command line, enter show variables like 'character _ set _ % '; www.2cto.com to view the current encoding. On the MySQL command line, enter set names utf8; it is equivalent to set character_set_client = utf8; set bandwidth = utf8; set character_set_connection = utf8; the three commands www.2cto.com run the set names gbk command before the command line inserts data; or set names gb2312; run the set names gbk command before inserting the query data; or set names gb2312; after the query is complete, set names utf8; then the Chinese language can be inserted and queried normally and the database code is utf8.

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.