List:MySQL++« Previous MessageNext Message »
From:Hanson Lu Date:October 20 2006 2:11am
Subject:Connection character set be changed silently?
View as plain text  
My programm connect to MYSQL server(4.1.12),  set it's character set by
"set NAMES gbk", the variables when client programm started is

character_set_client                              gbk
character_set_connection
gbk
character_set_database                        gbk
character_set_results                            gbk
character_set_server                             gbk


After a long while, like one  night, I found the client character set have
been changed to latin,

character_set_client                              latin1
character_set_connection                     latin1
character_set_database                       gbk
character_set_results                           latin1
character_set_server                            gbk

it seems related to some "timeout" value, the wait_timeout and
interative_timeout is 28800(8 hours).

I tested same program with MySQL 4.1.7,  the connection was disconnnected by
server since wait_timeout was set to 8 hours.

why the characoter set would be changed  with MYSQL 4.1.12?  My programm use
MYSQL C API.

MySQL setting : My.cnf
[mysqld]
socket=/var/lib/mysql/mysql.sock
# Default to using old password format for compatibility with mysql 3.x
# clients (those using the mysqlclient10 compatibility package).
old_passwords=1
default-character-set=gbk
[mysql.server]
user=mysql
default-character-set=gbk
default-collation=gbk_bin
[mysqld_safe]
err-log=/var/log/mysqld.log
pid-file=/var/run/mysqld/mysqld.pid
default-character-set=gbk

[mysql]
default-character-set=gbk

Thanks
Hanson

Thread
Connection character set be changed silently?Hanson Lu20 Oct
  • Re: Connection character set be changed silently?Warren Young20 Oct