Solve SQL garbled characters in the Mac Console

Source: Internet
Author: User

MySQL solves SQL garbled characters on the Mac console 1. scenario: the mysql database is on the slave machine and the slave machine is on the LAN, again, the ssh standby machine (standby machine) is a bit similar to the following Architecture, so I cannot directly connect to the tool, so I have to go to SSH, then mysql-u root-p, insert update, however, garbled characters occur during operations such as insert select. The first thought was that variables was not set properly. After show, it is true that all set character_set_client = 'utf8' is utf8. Note that it is not UTF-8. character_set_filesystem is not required. The file itself is binary. After the data operation, it is OK. Description: mysql5 provides the following system variables for setting character sets: character_set_client Character Set character_set_connection character set used for client-to-server connection character_set_results SELECT to query the character set of returned data character_set_database the character set garbled problem is generally caused by incorrect settings of the preceding variables, note: character_set_client and character_set_connection must be consistent with character_set_database encoding, while character_set_results must be consistent with the code returned by the SELECT statement and the program. We can use set names in the program to set the three system variables character_set_client, character_set_connection, and character_set_results at the same time.

Related Article

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.