dbTalk Databases Forums  

Connection character set be changed silently?

mailing.database.mysql-plusplus mailing.database.mysql-plusplus


Discuss Connection character set be changed silently? in the mailing.database.mysql-plusplus forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Hanson Lu
 
Posts: n/a

Default Connection character set be changed silently? - 10-19-2006 , 09:12 PM






------=_Part_14709_17401913.1161310305355
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

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

------=_Part_14709_17401913.1161310305355--

Reply With Quote
  #2  
Old   
Warren Young
 
Posts: n/a

Default Re: Connection character set be changed silently? - 10-20-2006 , 05:27 AM






Hanson Lu wrote:
Quote:
why the characoter set would be changed with MYSQL 4.1.12?
Because the character set is a connection attribute. When the
connection was re-established, the character set returned to its default.

Quote:
My programm use MYSQL C API.
Then please use the main MySQL list for this sort of thing in the
future. This list is only for MySQL++, the C++ wrapper for the C API.

--
MySQL++ Mailing List
For list archives: http://lists.mysql.com/plusplus
To unsubscribe: http://lists.mysql.com/plusplus?unsu...ie.nctu.edu.tw



Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.