SET NAMES
Description
Sets the client, connection, and result character sets and collations.
Syntax
SET NAMES charset_name [COLLATE collation_name]
Parameters
| Parameter | Description |
|---|---|
| charset_name | Specifies the client, connection, and result character sets. Valid values are utf8mb4 and binary. |
| collation_name | Specifies the connection collation. Valid values are binary, utf8mb4_bin, utf8mb4_general_ci, and utf8mb4_unicode_ci; it must match charset_name. |
Examples
Set the client, connection, and result character sets to utf8mb4 and the collation to utf8mb4_bin.
SET NAMES utf8mb4 COLLATE utf8mb4_bin;
Query OK, 0 rows affected (0.126 sec)