Problem setting the "default-character-set" parameter in my.ini file.
Posted by: sachin vyas
Date: July 31, 2012 01:38AM

Hello,
I am trying to change the value for the variable "default-character-set" to latin1 as below in the "my.ini" file:

before change
===============

mysql> show variables like 'character%';
+--------------------------+---------------------------------------------------------+
| Variable_name | Value |
+--------------------------+---------------------------------------------------------+
| character_set_client | utf8 |
| character_set_connection | utf8 |
| character_set_database | utf8 |
| character_set_filesystem | binary |
| character_set_results | utf8 |
| character_set_server | utf8 |
| character_set_system | utf8 |
| character_sets_dir | C:\Program Files\MySQL\MySQL Server 5.5\share\charsets\ |
+--------------------------+---------------------------------------------------------+
8 rows in set (0.00 sec)

Now, I made the following change o "my.ini" file:

[mysql]
default-character-set=latin1

Now, after making the above change, when I save the file & reconnect as "root" user & execute the command "show variables like 'character%';" I get the following output:
(I even tried restarting the mysql service after making the changes to the "my.ini" file, but did not get the expected results.)

mysql> show variables like 'character%';
+--------------------------+---------------------------------------------------------+
| Variable_name | Value |
+--------------------------+---------------------------------------------------------+
| character_set_client | utf8 |
| character_set_connection | utf8 |
| character_set_database | utf8 |
| character_set_filesystem | binary |
| character_set_results | utf8 |
| character_set_server | utf8 |
| character_set_system | utf8 |
| character_sets_dir | C:\Program Files\MySQL\MySQL Server 5.5\share\charsets\ |
+--------------------------+---------------------------------------------------------+
8 rows in set (0.00 sec)

Query
=====
Shouldn't the values for :
1) character_set_client
2) character_set_connection
3) character_set_server
be = latin1.

When I try doing the same change from command line using the command, it works as expected :

mysql -u root -pmanager --default-character-set=latin1

Now, I exceute the following at mysql prompt:

mysql> show variables like 'character%';
+--------------------------+---------------------------------------------------------+
| Variable_name | Value |
+--------------------------+---------------------------------------------------------+
| character_set_client | latin1 |
| character_set_connection | latin1 |
| character_set_database | utf8 |
| character_set_filesystem | binary |
| character_set_results | latin1 |
| character_set_server | utf8 |
| character_set_system | utf8 |
| character_sets_dir | C:\Program Files\MySQL\MySQL Server 5.5\share\charsets\ |
+--------------------------+---------------------------------------------------------+
8 rows in set (0.00 sec)

As per MySQL documentation http://dev.mysql.com/doc/refman/5.5/en/server-options.html#option_mysqld_default-character-set
I changed the variable name to character-set-server, but that did n't help either.

But, If the above link is true then how did it work for the command:
mysql -u root -pmanager --default-character-set=latin1
since --default-character-set is deprecated from MySQl 5.5.3 ?

Options: ReplyQuote




Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.