Bug #12156 --default-character-set for client not working
Submitted: 25 Jul 2005 15:47 Modified: 27 Jul 2005 23:11
Reporter: Piotr Szumny Email Updates:
Status: Can't repeat Impact on me:
None 
Category:MySQL Server Severity:S2 (Serious)
Version:4.1.13 OS:Windows (Windows XP)
Assigned to: CPU Architecture:Any

[25 Jul 2005 15:47] Piotr Szumny
Description:
When I try to connect to the server with specified character set:

mysql --default-character-set=latin2

I see message:

mysql: Character set 'latin2' is not a compiled character set and is not specifi
ed in the 'C:\mysql\\share\charsets\Index.xml' file.

But MySQL is installed in
c:\Program Files\MySQL\MySQL Server 4.1\

How to repeat:
Installaction MySQL 4.1.13 (mysql-essential-4.1.13-win32.msi) with server character-set - latin2
[25 Jul 2005 16:28] MySQL Verification Team
I was unable to repeat the behavior reported.

c:\mysql\bin>type c:\my.ini
[client]
default-character-set=latin2

[mysqld]
default-character-set=latin2
c:\mysql\bin>mysql -uroot
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 1 to server version: 4.1.13-nt

Type 'help;' or '\h' for help. Type '\c' to clear the buffer.

mysql> show variables like "%character%";
+--------------------------+--------------------------+
| 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                     |
| character_sets_dir       | c:\mysql\share\charsets/ |
+--------------------------+--------------------------+
7 rows in set (0.00 sec)

mysql>

c:\mysql\bin>type c:\my.ini
[mysqld]
default-character-set=latin2
c:\mysql\bin>mysql -uroot --default-character-set=latin2
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 2 to server version: 4.1.13-nt

Type 'help;' or '\h' for help. Type '\c' to clear the buffer.

mysql> show variables like "%character%";
+--------------------------+--------------------------+
| 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                     |
| character_sets_dir       | c:\mysql\share\charsets/ |
+--------------------------+--------------------------+
7 rows in set (0.00 sec)

mysql>
[25 Jul 2005 17:53] Piotr Szumny
Try to install not in c:\mysql directory. I've installed in Program Files
[27 Jul 2005 22:59] Piotr Szumny
I try to install on other machine and problem still exists.
I installed from binaries (from file mysql-essential-4.1.13-win32.msi) in default directory (c:\Program Files\MySQL\MySQL Server 4.1\) with latin2 charset.
Installation was OK.
After a command: mysql -uroot -p
I see result:
mysql: Character set 'latin2' is not a compiled character set and is not specifi
ed in the 'C:\mysql\\share\charsets\Index.xml' file.

Why program try to read from C:\mysql\ direcory?
[27 Jul 2005 23:11] MySQL Verification Team
Try to start the client like below:

mysql --defaults-file=path_where_is_my_ini -uroot -p

what happens is that the default locations are c:\my.ini and
c:\win_dir(windows)\my.ini
[28 Jul 2005 8:09] Piotr Szumny
That's the result.

C:\Program Files\MySQL\MySQL Server 4.1>mysql --defaults-file="C:\Program Files\MySQL\MySQL Server 4.1\my.ini" -uroot -p
mysql: Character set 'latin2' is not a compiled character set and is not specifi
ed in the 'C:\mysql\\share\charsets\Index.xml' file

The service MySQL use my.ini from "C:\Program Files\MySQL\MySQL Server 4.1\my.ini" eg.:
C:\Program Files\MySQL\MySQL Server 4.1>sc qc MySQL
[SC] GetServiceConfig SUCCESS

SERVICE_NAME: MySQL
        TYPE               : 10  WIN32_OWN_PROCESS
        START_TYPE         : 2   AUTO_START
        ERROR_CONTROL      : 1   NORMAL
        BINARY_PATH_NAME   : "C:\Program Files\MySQL\MySQL Server 4.1\bin\mysqld
-nt" --defaults-file="C:\Program Files\MySQL\MySQL Server 4.1\my.ini" MySQL
        LOAD_ORDER_GROUP   :
        TAG                : 0
        DISPLAY_NAME       : MySQL
        DEPENDENCIES       :
        SERVICE_START_NAME : LocalSystem
[23 Aug 2005 22:33] Piotr Szumny
After reinstalling Windows XP I installed MySQL 4.1.13a again. The problem still exists. I think it's problem with binaries for Windows. When I install in c:\mysql directory it works OK. The path for character sets is hardcoded in mysqld.exe. Maybe this is a reason for that error.