MySQL solves bitsCN.com with SQL garbled characters in the Mac console
Solve SQL garbled characters in the Mac console
1. scenario: the mysql database is on the slave machine, the slave machine is on the LAN, the ssh host is required, and then the ssh slave machine (the slave machine) is on the client machine) similar to the following architecture
As a result, I cannot directly connect to the tool, so I have 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 properly set. show, indeed.
Set character_set_client = 'utf8' to utf8. Note that it is not utf-8. character_set_filesystem is not required. The file itself is binary.
Then perform the data operation.
Note:
Mysql5 provides the following system variables for setting character sets:
Character_set_client client character set
Character_set_connection character set used for client-to-server connection
Character_set_results SELECT character set of the returned data
Character_set_database character set used by the database
Garbled characters are 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,
Character_set_results ensures that the returned results are encoded with 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.
BitsCN.com