Purpose
You can use this statement to set the character set and collation for the client, connection, and result.
Syntax
SET NAMES charset_name [COLLATE collation_name]
Parameters
| Parameter | Description |
|---|---|
| charset_name | The default character set for columns in the table. Valid values:
|
| collation_name | The default collation for columns in the table. Valid values:
|
Examples
Set the character set to gbk and the collation to gbk_bin for the client, connection, and result.
obclient> SET NAMES gbk COLLATE gbk_bin;
Query OK, 0 rows affected