Post new topic   Reply to topic
View previous topic Printable version Log in to check your private messages View next topic
Author Message
ziban
Post subject: [Closed] MySQL character Encoding problem  PostPosted: Nov 11, 2006 - 08:08 PM
Registered Member
Registered Member


Joined: Sep 28, 2006
Posts: 2

I cannot connect to MySQL database. When connecting, it display an error as follow:

Error while trying to login to database:
Unknown initial character set index '48' received from server. Initial client character set can be forced via the 'characterEncoding' propoerty.

I set mysql character encoding to the default : utf-8:unicode.

Solution :
A. set the JDBC encoding property
But I dont know whether there is any way to set the JDBC character encoding property.
B. Change the database to JDBC encoding property
But I dont know what character encoding the JDBC is using

Please advise.

Many thanks in advance.
 
 View user's profile Send private message  
Reply with quote Back to top
support-snpe
Post subject:   PostPosted: Nov 12, 2006 - 03:49 AM
Moderator
Moderator


Joined: Feb 03, 2006
Posts: 1117

ziban,

Try set jdbc URL to something like this :
jdbc:mysql://<YOUR_HOST>:<YOUR_PORT>/<YOUR_DATABASE>?useUnicode=true&characterEncoding=UTF-8

See http://dev.mysql.com/doc/refman/5.0/en/connector-j-reference-configuration-properties.html for more details

Regards,

_________________
Peco
MyEclipse Support
Please do us a big favor and remember to vote for MyEclipse at the JDJ Reader's Choice Awards.
We really appreciate it!
 
 View user's profile Send private message  
Reply with quote Back to top
harrz
Post subject:   PostPosted: Nov 12, 2006 - 02:07 PM



Joined: Oct 17, 2005
Posts: 1

hi ziban,

i had that problem just a few days ago. I solved it by using an older jdbc driver (version 3.0).
 
 View user's profile Send private message  
Reply with quote Back to top
ziban
Post subject:   PostPosted: Nov 13, 2006 - 09:20 PM
Registered Member
Registered Member


Joined: Sep 28, 2006
Posts: 2

got it done.... apologise... i checked in mysql.ini, the connection character encoding was latin.... i changed it then to utf8 and sorted.

Many thanks to the replies : )
 
 View user's profile Send private message  
Reply with quote Back to top
Display posts from previous:     
Jump to:  
All times are GMT - 6 Hours
Post new topic   Reply to topic
View previous topic Printable version Log in to check your private messages View next topic
Powered by PNphpBB2 © 2003-2004 The PNphpBB Group
Credits