Re: [Sqlrelay-discussion] UTF8 string become "Question mark" with mysql ?
Brought to you by:
mused
From: David M. <dav...@fi...> - 2011-12-29 06:44:04
|
Hello, The most likely cause of this is that someone has run a "set names 'ascii'" query or something similar. The default mysql client character set supports utf-8 characters, but if the character set is manually changed to something that does not, such as ascii, then utf-8 characters will be returned as ?'s. For example: [dmuse@db ~]$ mysql -utestuser -ptestpassword testdb Reading table information for completion of table and column names You can turn off this feature to get a quicker startup with -A Welcome to the MySQL monitor. Commands end with ; or \g. Your MySQL connection id is 9173 Server version: 5.1.58 Source distribution Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved. This software comes with ABSOLUTELY NO WARRANTY. This is free software, and you are welcome to modify and redistribute it under the GPL v2 license Type 'help;' or '\h' for help. Type '\c' to clear the current input statement. mysql> select * from testutf8; +--------+ | col1 | +--------+ | Falló | +--------+ 1 row in set (0.00 sec) mysql> set names 'ascii'; Query OK, 0 rows affected (0.00 sec) mysql> select * from testutf8; +--------+ | col1 | +--------+ | Fall?? | +--------+ 1 row in set (0.00 sec) mysql> The character set is reset to the default every time you log out of mysql and back in. The problem is that sql relay never logs out or back in. So, if someone runs a "set names" query (or similar) then it will persist until someone runs a query to reset the character set or restarts sqlrelay. For the next release, I'm working on a way to reset various things at session-end, including the character set. An interim solution though would be to find the app that changes the character set and add a query to reset it when it closes the connection. I hope this helps. Let me know if this is a workable solution for you or not. David Muse dav...@fi... On 12/21/2011 02:11 AM, lee angus wrote: > Dear all > We are using sqlrely with mysql. > The beginnng,querey UTF8 string retun correctlly on our production > machine. > After a few days,UFT8 string become "??????". > Then,we restart sqlrelay daemond,and UTF8 string retun correctlly again. > When the problem occured,we tried to use sqlrsh to execute query,the > UTF8 string has become "???????". > > My env as below > Sqlrelay 0.43 > rudiments 0.34 > Mysql client 5.1.59 > MariaDB 5.1.53 > > Any suggestion will be very appreciated !! > > > > > > > ------------------------------------------------------------------------------ > Write once. Port to many. > Get the SDK and tools to simplify cross-platform app development. Create > new or port existing apps to sell to consumers worldwide. Explore the > Intel AppUpSM program developer opportunity. appdeveloper.intel.com/join > http://p.sf.net/sfu/intel-appdev > > > _______________________________________________ > Sqlrelay-discussion mailing list > Sql...@li... > https://lists.sourceforge.net/lists/listinfo/sqlrelay-discussion _______________________________________________________ Unlimited Disk, Data Transfer, PHP/MySQL Domain Hosting http://www.doteasy.com |