Re: Problem setting the "default-character-set" parameter in my.ini file.
Posted by: sachin vyas
Date: July 31, 2012 11:00PM

Thanks Rick James.

I logged in using another user id + DB as mentioned below:

mysql -u test_user -ptestpwd test_db

The my.ini file has the same value for "default-character-set" as mentioned below:

[mysql]
default-character-set=latin1

Now when I execute the following command, I still get the same utf8 character set data (as mentioned in my very first post)

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.05 sec)

Now, I log out & reconnect using the following command:

mysql -u test_user -ptestpwd test_db --default_character_set latin1

& execute the following command & get the expected output:

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)


Regards,
Sachin Vyas.

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.