Hello.
For a pity, I could give explanations only for your query about selecting @@global.xxx variables. I think server returns correct results, because you're selecting global variables, while character_set_client, character_set_connection, character_set_results are session variables. And with SET NAMES you're setting @@character_xxx variables which are synonym for @@session.character_xxx. In what way have you done your upgrade? If you haven't used mysqldump you could get some problems. Make the dump, and restore it setting the correct connection variables for mysql program. Be aware of that mysqldump could put SET NAMES at the beginning of the dump file. Use set-names=latin2 for it. See: http://dev.mysql.com/doc/mysql/en/mysqldump.html Arkadiusz Miskiewicz <[EMAIL PROTECTED]> wrote: > Hi, > > I have mysql 4.0 db with configuration: > set-variable =3D default-character-set=3Dlatin2 > set-variable =3D character-set=3Dlatin2 > > now I'm trying to migrate to mysql 4.1.12 My current config is: > character-set-server=3Dlatin2 > collation-server=3Dlatin2_general_ci > > The problem is connection/reply/client-character set. mysql 4.1 by default= > =20 > uses 'latin1' so in all queries (from previously latin2 mysql 4.0 database)= > I=20 > don't have latin2 characters just '?' chars. That's obvious because due to= > =20 > default latin1 in 4.1. > > SET NAMES 'latin2' from client side of coruse cures whole problem but... I= > =20 > can't fix every possible application that my users have installed (and if=20 > there are thousands of users this is simply impossible). > > What's the proper way of dealing with this problem? I've tried to use some= > =20 > nasty hacks like init-connect=3D"SET NAMES latin2" and this half-works - I = > see=20 > latin2 characters in server responses... but it breaks for example phpmyadm= > in=20 > (characters are broken in results; when I drop init-connect hack phpmyadmin= > =20 > works nicely). So init-connect isn't usable. > > Now when connecting with mysql command line client then I by default get=20 > latin1 but can change easily to latin2 using=20 > [mysql] > default-character-set=3Dlatin2 > in .my.cnf file. That's great but this works only for mysql cmd line client= > =20 > _only_ while my primary concern is php. > > Now is the funny part, there is no .my.cnf file, I connect with mysql cmdli= > ne. > mysql> \s > =2D------------- > mysql Ver 14.7 Distrib 4.1.12, for pld-linux-gnu (powerpc) using readline = > 4.3 > > Connection id: 2 > Current database: > Current user: [EMAIL PROTECTED] > SSL: Not in use > Current pager: stdout > Using outfile: '' > Using delimiter: ; > Server version: 4.1.12-log > Protocol version: 10 > Connection: Localhost via UNIX socket > Server characterset: latin2 > Db characterset: latin2 > Client characterset: latin1 > Conn. characterset: latin1 > UNIX socket: /var/lib/mysql/mysql.sock > Uptime: 34 min 35 sec > > Threads: 1 Questions: 12 Slow queries: 0 Opens: 11 Flush tables: 1 Ope= > n=20 > tables: 0 Queries per second avg: 0.006 > =2D------------- > > 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 | > | character_sets_dir | /usr/share/mysql/charsets/ | > +--------------------------+----------------------------+ > 7 rows in set (0.00 sec) > > As you can see client/connection/results are latin1 BUT: > > mysql> select @@global.character_set_client,=20 > @@global.character_set_connection, @@global.character_set_database,=20 > @@global.character_set_results, @@global.character_set_results,=20 > @@global.character_set_server; > +-------------------------------+-----------------------------------+------= > =2D--------------------------+--------------------------------+------------= > =2D-------------------+-------------------------------+ > | @@global.character_set_client | @@global.character_set_connection |=20 > @@global.character_set_database | @@global.character_set_results |=20 > @@global.character_set_results | @@global.character_set_server | > +-------------------------------+-----------------------------------+------= > =2D--------------------------+--------------------------------+------------= > =2D-------------------+-------------------------------+ > | latin2 | latin2 | latin= > 2 =20 > | latin2 | latin2 | latin2 = > =20 > | > +-------------------------------+-----------------------------------+------= > =2D--------------------------+--------------------------------+------------= > =2D-------------------+-------------------------------+ > 1 row in set (0.00 sec) > > now it tells me that these are latin2!? > > Anyway primary question is how to deal with characters in mysql 4.0->4.1=20 > conversion (how to get latin2 as default in client connections)? I've talke= > d=20 > with few people on #mysql on freenode but we haven't seen any solution. > > =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 / /|_/ / // /\ \/ /_/ / /__ [EMAIL PROTECTED] /_/ /_/\_, /___/\___\_\___/ MySQL AB / Ensita.NET <___/ www.mysql.com -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe: http://lists.mysql.com/[EMAIL PROTECTED]