| Quote: |
10.4. Connection Character Sets and Collations
Several character set and collation system variables relate to a client's interaction with the server. Some of these have been mentioned in earlier sections:
*The server character set and collation can be determined from the values of the character_set_server and collation_server system variables.
*The character set and collation of the default database can be determined from the values of the character_set_database and collation_database system variables.
(...)
There are two statements that affect the connection character sets:
SET NAMES 'charset_name'
SET CHARACTER SET charset_name
SET NAMES indicates what character set the client will use to send SQL statements to the server. Thus, SET NAMES 'cp1251' tells the server “future incoming messages from this client are in character set cp1251.” It also specifies the character set that the server should use for sending results back to the client. (For example, it indicates what character set to use for column values if you use a SELECT statement.) |