今天帮同事处理一个棘手的事情,问题是这样的:
无论在客户机用哪个版本的mysql客户端连接服务器,发现只要服务器端设置了
之后,
就始终都是和服务器端保持一致了,即便在mysql客户端加上选项
也不行,除非连接进去后,再手工执行命令
,才会将client、connection、results的字符集改过来。
经过仔细对比,最终发现让我踩坑的地方是,服务器端设置了另一个选项:
文档上关于这个选项的解释是这样的:
Don’t ignore character set information sent by the client. To ignore client information and use the default server character set, use –skip-character-set-client-handshake; this makes MySQL behave like MySQL 4.0