There are many types of character sets in the database, and the main influence on programming is the client character set and database character set (there is also a server character set, do not know what to do).
The common operation in the database is to save the data and read the data, in this process, chaos and the database character set does not seem to have any relationship. We only need to ensure that the character set that is selected at write time is consistent with the character set chosen when reading, that is, only the client character set of two operations can be guaranteed.
Settings for the client character set, depending on the client's different methods:
1. Use the console connection, set in the client item in the My.ini file;
2. Use EMS connection, priority to use the character set of EMS connection configuration, use the setting in My.ini file by default;
3.JDBC connection, specified in the connection string:
Jdbc:mysql://192.168.3.99:3306/test?useunicode=true&;characterencoding=gbk
When written, MYSQ converts the character set specified by the client to the database character set, which is displayed to the client by converting the database character set to the client-specified character set, and the client character set and database characters are set consistently, and the obvious benefit is to avoid the performance loss of the conversion; Setting the database character set to the character set supported by most databases is a big hassle if you take into account the migration of the database later.