cancel
Showing results for 
Search instead for 
Did you mean: 

How to modify database to UTF-8?

jilingshu
Champ in-the-making
Champ in-the-making
hi there,
I found that the table in database is in latin1 encoding. I wanna modify it to UTF8 to support CJK characters. If I modify the tables to UTF8, Alfresco would not run and the log said:
— Cause: java.sql.SQLException: Illegal mix of collations (latin1_swedish_ci,IMPLICIT) and (utf8_general_ci,COERCIBLE) for operation '='; nested exception is com.ibatis.common.jdbc.exception.NestedSQLException:
— The error occurred while applying a parameter map.
— Check the alfresco.node.select_ChildAssocsOfParent-InlineParameterMap.
— Check the statement (query failed).
— Cause: java.sql.SQLException: Illegal mix of collations (latin1_swedish_ci,IMPLICIT) and (utf8_general_ci,COERCIBLE) for operation '='
        at org.springframework.jdbc.support.AbstractFallbackSQLExceptionTranslator.translate(AbstractFallbackSQLExceptionTranslator.java:83)
and so on.
Could you tell me how to fix it? thx!
3 REPLIES 3

nramdoo
Champ in-the-making
Champ in-the-making
hello,
I don't if this will help, you may check that you have the following lines in your alfresco-global.properties file.

# MySQL connection
#
db.driver=org.gjt.mm.mysql.Driver
db.url=jdbc:mysql://${db.host}:${db.port}/${db.name}?useUnicode=yes&characterEncoding=UTF-8"

This part "?useUnicode=yes&characterEncoding=UTF-8" concerns internationalisation.
bye

stegbth
Champ in-the-making
Champ in-the-making
hi,

this string is default in 3.4d
but how should the data from a previous version get converted?

best regards
thomas

mrogers
Star Contributor
Star Contributor