On Monday 11 of July 2005 16:24, Gleb Paharenko wrote:
> 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
> @@[EMAIL PROTECTED];  set
> @@[EMAIL PROTECTED]; set
> @@[EMAIL PROTECTED]; '
[...]
> So it works for me.

I've ended doing this in a different way. I've created a patch which forces a 
file to be read - /etc/mysql/mysql-client.conf (which is the same as .my.cnf) 
at mysql_init() time. All clients that use libmysqlclient.so should read it 
now.

http://cvs.pld-linux.org/cgi-bin/cvsweb/SOURCES/mysql-client-config.patch?rev=1.1

Now I can put defaults in that global config:

[EMAIL PROTECTED] ~]$ more /etc/mysql/mysql-client.conf
[client]
default-character-set=latin2

Now all my clients connect with latin2 as default.

Any possible problems with this approach?

-- 
Arkadiusz Miƛkiewicz                    PLD/Linux Team
http://www.t17.ds.pwr.wroc.pl/~misiek/  http://ftp.pld-linux.org/

--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:    http://lists.mysql.com/[EMAIL PROTECTED]

Reply via email to