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.