码迷,mamicode.com
首页 > 其他好文 > 详细

SET NAMES

时间:2016-09-04 01:41:20      阅读:190      评论:0      收藏:0      [点我收藏+]

标签:

High Performance MySQL, Third Editionby Baron Schwartz, Peter Zaitsev, and Vadim Tkachenko

Settings for client/server communication When the server and the client communicate with each other, they might send data back and forth in different character sets. The server will translate as needed:

• The server assumes the client is sending statements in the character set specifiedby character_set_client.

• After the server receives a statement from the client, it translates it into the characterset specified by character_set_connection. It also uses this setting to determinehow to convert numbers into strings.

• When the server returns results or error messages back to the client, it translatesthem into character_set_result.

Suppose you open a client connection with latin1 (the default character set, unlessyou’ve used mysql_options() to change it) and then use SET NAMES utf8 to tell the serverto assume the client is sending data in UTF-8. You’ve created a character set mismatch,which can cause errors and even security problems.

SET NAMES

标签:

原文地址:http://www.cnblogs.com/yuanjiangw/p/5838445.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!