List:General Discussion« Previous MessageNext Message »
From:Gleb Paharenko Date:July 11 2005 2:24pm
Subject:Re: mysql 4.0 to 4.1 migration and charset problems
View as plain text  
Hello.

I've tested your solution. It doesn't work for users which have SUPER
privilege. This mentioned at:
  http://dev.mysql.com/doc/mysql/en/server-system-variables.html

However, it works with with ordinary users which don't have SUPER
privilege. Here are pieces of my my.cnf (the init_connect is one big string
without line breaks):

[client]

default_character_set=latin1

[mysqld]
default_character_set=latin2
init_connect='SET @lchar = IF(@@session.character_set_client =
_utf8"latin1", @@global.character_set_client,
@@session.character_set_client); set
@@session.character_set_client=@lchar;  set
@@session.character_set_connection=@lchar; set
@@session.character_set_results=@lchar; '


When root user connects init_connect doesn't execute and we see:
 mysql> show variables like '%char%';
 +--------------------------+-------------------------------------------------------------------------------+
 | Variable_name            | Value                   |
 +--------------------------+-------------------------------------------------------------------------------+
 | character_set_client     | latin1                   |
 | character_set_connection | latin1                   |
 | character_set_database   | latin2                   |
 | character_set_results    | latin1                   |
 | character_set_server     | latin2                   |
 | character_set_system     | utf8                   |
 |


When user without SUPER privilege connects we see:
  | Variable_name            | Value                   |
	+--------------------------+-------------------------------------------------------------------------------+
	| character_set_client     | latin2                   |
	| character_set_connection | latin2                   |
	| character_set_database   | latin2                   |
	| character_set_results    | latin2                   |
	| character_set_server     | latin2                   |
	| character_set_system     | utf8                   |



So it works for me.






>>   http://dev.mysql.com/doc/mysql/en/mysqldump.html
> Dump & restore was done properly. dump on 4.0, add set names latin2; load i=
> nto=20
> 4.1. The problem is that by default connections from client are as latin1, =
> db=20
> is latin2 so servers needs to do conversion from latin2->latin1 which can't=
> =20
> be done and thus I'm getting '?' characters instead of latin2 characters.
> 
> The thing I need is how to force default latin2 in all client connections e=
> ven=20
> if client won't request latin2 by using set names.
> 
> Tried doing things like in mysqld.conf:
> 
> init-connect =3D SET @lchar =3D IF(@@session.character_set_client =3D _utf8=
> "latin1",=20
> @@global.character_set_client, @@session.character_set_client); SET=20
> character_set_client =3D @lchar; SET character_set_results =3D @lchar; SET=
> =20
> character_set_connection =3D @lchar;
> 
> but that doesn't work unfortunately from init-connect (works from mysql=20
> cmdline client) ;-(
> =2D-=20
> Arkadiusz Mi=B6kiewicz                    PLD/Linux Team
> http://www.t17.ds.pwr.wroc.pl/~misiek/  http://ftp.pld-linux.org/
> 


-- 
For technical support contracts, goto https://order.mysql.com/?ref=ensita
This email is sponsored by Ensita.NET http://www.ensita.net/
   __  ___     ___ ____  __
  /  |/  /_ __/ __/ __ \/ /    Gleb Paharenko
 / /|_/ / // /\ \/ /_/ / /__   Gleb.Paharenko@stripped
/_/  /_/\_, /___/\___\_\___/   MySQL AB / Ensita.NET
       <___/   www.mysql.com



Thread
mysql 4.0 to 4.1 migration and charset problemsArkadiusz Miskiewicz6 Jul
  • Re: mysql 4.0 to 4.1 migration and charset problemsGleb Paharenko7 Jul
    • Re: mysql 4.0 to 4.1 migration and charset problemsArkadiusz Miskiewicz11 Jul
      • Re: mysql 4.0 to 4.1 migration and charset problemsGleb Paharenko11 Jul
        • Re: mysql 4.0 to 4.1 migration and charset problemsArkadiusz Miskiewicz11 Jul
          • Re: mysql 4.0 to 4.1 migration and charset problemsGleb Paharenko12 Jul
        • Re: mysql 4.0 to 4.1 migration and charset problemsVivian Wang14 Jul
          • Re: mysql 4.0 to 4.1 migration and charset problemsGleb Paharenko15 Jul