• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 353
  • Last Modified:

I cannot upload Japanese characters into my db - please help

Hi,
I'm trying to upload Japanese characters into the db without success.
My tabels are set as default charset utf8.
I set my my.ini file as follows:
[mysqld]
...
...
init-connect='SET NAMES utf8'
default-character-set=utf8
....

When I execute - show variables like '%character%';
I get
character_set_client  = latin1  
character_set_connection = latin1
character_set_database  =latin1
All others are set as utf8

How can I set those character sets to be utf8?
When I execute
mysql> Set character_set_connection=utf8;
I updates to utf8 but when I exit and restart the service it is changed back to latin1.
Can I modify them in my.ini file? I tried without success.
Again, All I want to do is to insert japanese chracters into my db.
I'm using java code to execute queries but I prefer to do the change in the configuration file.
Please advice
Thanks
Yossi
0
YossiBa
Asked:
YossiBa
  • 11
  • 5
1 Solution
 
ellandrdCommented:
0
 
ellandrdCommented:
0
Veeam Disaster Recovery in Microsoft Azure

Veeam PN for Microsoft Azure is a FREE solution designed to simplify and automate the setup of a DR site in Microsoft Azure using lightweight software-defined networking. It reduces the complexity of VPN deployments and is designed for businesses of ALL sizes.

 
YossiBaAuthor Commented:
Yes, Ive looked at the manual, but as I wrote, nothing work for me.
I specified in details all my action.
What do I do wrong?
Thanks
0
 
ellandrdCommented:
it is uploading or not displaying property?

as uploading to mysql should be accepted as a string value?

did you check out: http://bugs.mysql.com/bug.php?id=3982
0
 
YossiBaAuthor Commented:
Hi,
I have looked at all the links you sent me,
I know some of them, the others dont help me much with a solution.
I know I need to set my db to work with utf8, but it doesnt really, although I have made the settings I mentioned above.
:-(
0
 
ellandrdCommented:
http://www.webmasterworld.com/forum32/801.htm

what is your version of mysql?
0
 
ellandrdCommented:
think i found an answer to your problem...

Japanese character set contain so many characters that they cannot all be represented in a single byte, so each character requires multiple bytes to be stored.

this is why you can upload them!  your datatype is set as string (varchar) i assume and mysql is treating characters as binary reading them in bytes and japanese character cant be read in single bytes, hence your problem...

ellandrd
0
 
ellandrdCommented:
resolved or still having problems?
0
 
YossiBaAuthor Commented:
Thanks for the efforts,
I have 4.1 ver of mysql
I didnt tell you,
when I use ALTER TABLE myTable MODIFY myColumn VARCHAR(255) CHARACTER SET utf8;

It works well,
my problem is that I cannot do that, I'm not allowed to change column setting in the db(different reasons), do you know of a solution that do not require db changes?

Thanks again
0
 
ellandrdCommented:
with out making changes to db, there will be very little you can do to fix your issue...sorry
0
 
YossiBaAuthor Commented:
Thanks man for all your help ;-)
0
 
ellandrdCommented:
did you geta  fix?

glad i was of some help...

ellandrd
0
 
YossiBaAuthor Commented:
yes,
I used finally
java.sql.Statement stmt = conn.createStatement();
stmt.execute("ALTER TABLE scheduled_task MODIFY TaskProperties VARCHAR(255) CHARACTER SET utf8");

Thanks a lot
0

Featured Post

Upgrade your Question Security!

Add Premium security features to your question to ensure its privacy or anonymity. Learn more about your ability to control Question Security today.

  • 11
  • 5
Tackle projects and never again get stuck behind a technical roadblock.
Join Now