content_image/845898.jpg content_image/845899.jpg
When a client connects, it sends to the server the name of the character set that it wants to use. The server uses the name to set the character_set_client , character_set_results , and character_set_connection  system variables. In effect, the server performs a SET NAMES  operation using the character set name. 

The effect of this is that you cannot control the client character set by starting mysqld  with -- character-set-server=utf8 . However, some Asian customers prefer the MySQL 4.0 behavior. To make it possible to retain this behavior, we added a mysqld  switch, --character- set-client-handshake , which can be turned off with --skip-character-set-client- handshake . If you start mysqld  with --skip-character-set-client-handshake , then, when a client connects, it sends to the server the name of the character set that it wants to use. However, the server ignores this request from the client . 

By way of example, suppose that your favorite server character set is latin1 . Suppose further that the client uses utf8  because this is what the client’s operating system supports. Start the server with latin1  as its default character set: 

mysqld --character-set-server=latin1 

And then start the client with the default character set utf8 : 

mysql --default-character-set=utf8 

The resulting settings can be seen by viewing the output of SHOW VARIABLES : 

mysql> SHOW VARIABLES LIKE ’char%’; 

<img src='content_image/845898.jpg'>

Now stop the client, and stop the server using mysqladmin . Then start the server again, but this time tell it to skip the handshake like so: 

mysqld --character-set-server=utf8 --skip-character-set-client-handshake 

Start the client with utf8  once again as the default character set, then display the resulting settings: 

mysql> SHOW VARIABLES LIKE ’char%’; 

<img src='content_image/845899.jpg'>

