Purpose
You can use this statement to set the client and result character set.
Syntax
SET {CHARSET CHARACTER SET} {DEFAULT charset_name};
Parameters
| Parameter | Description |
|---|---|
| charset_name | Specifies the client and result character set. Valid values:
|
| DEFAULT | Uses the default character set. |
Examples
Set the client character set to gbk.
obclient> SET CHARSET 'gbk';
Query OK, 0 rows affected (0.01 sec)
obclient> SHOW VARIABLES LIKE '%char%';
+--------------------------------------+---------+
Variable_name Value
+--------------------------------------+---------+
character_set_client gbk
character_set_connection utf8mb4
character_set_database utf8mb4
character_set_filesystem binary
character_set_results gbk
character_set_server utf8mb4
character_set_system utf8mb4
validate_password_special_char_count 0
+--------------------------------------+---------+
8 rows in set (0.00 sec)