top of page
CerebroSQL

MySQL: 

SET CHARSET

Syntax:
SET {CHARACTER SET | CHARSET}
{'charset_name' | DEFAULT}

This statement maps all strings sent between the server and the current
client with the given mapping. SET CHARACTER SET sets three session
system variables: character_set_client and character_set_results are
set to the given character set, and character_set_connection to the
value of character_set_database. See
https://dev.mysql.com/doc/refman/8.0/en/charset-connection.html.

charset_name may be quoted or unquoted.

The default character set mapping can be restored by using the value
DEFAULT. The default depends on the server configuration.

Some character sets cannot be used as the client character set.
Attempting to use them with SET CHARACTER SET produces an error. See
https://dev.mysql.com/doc/refman/8.0/en/charset-connection.html#charset
-connection-impermissible-client-charset.

URL: https://dev.mysql.com/doc/refman/8.0/en/set-character-set.html

Example

bottom of page