AW: [opencms-dev] Illegal mix of collations error

leightonbrown at excite.com leightonbrown at excite.com
Sat Jul 3 23:34:01 CEST 2004


Ok,
So I made the default char set utf8 in mysql now I get the error:
Tables could not be created!
Error executing SQL statement: create table CMS_PROJECTRESOURCES (PROJECT_ID INT NOT NULL, RESOURCE_NAME VARCHAR(218) NOT NULL, primary key(PROJECT_ID, RESOURCE_NAME), index projectresource_resource_name (RESOURCE_NAME))
-------------------------------------------
java.sql.SQLException: Syntax error or access violation message from server: "Specified key was too long. Max key length is 500" at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:2752) at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:1532) at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:1622) at com.mysql.jdbc.Connection.execSQL(Connection.java:2273) at com.mysql.jdbc.Connection.execSQL(Connection.java:2204) at com.mysql.jdbc.Statement.execute(Statement.java:868) at org.opencms.setup.CmsSetupDb.executeStatement(CmsSetupDb.java:283) at org.opencms.setup.CmsSetupDb.executeSql(CmsSetupDb.java:206) at org.opencms.setup.CmsSetupDb.createTables(CmsSetupDb.java:145) at org.apache.jsp.setup.step_005f5_005fdatabase_005fcreation_jsp._jspService(step_005f5_005fdatabase_005fcreation_jsp.java:350) at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:94) at javax.servlet.http.HttpServlet.service(HttpServlet.java:810) at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:298) at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:292) at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:236) at javax.servlet.http.HttpServlet.service(HttpServlet.java:810) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:237) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:157) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:214) at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104) at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520) at org.apache.catalina.core.StandardContextValve.invokeInternal(StandardContextValve.java:198) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:152) at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104) at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:137) at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:117) at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:102) at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109) at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104) at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520) at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:929) at org.apache.coyote.tomcat5.CoyoteAdapter.service(CoyoteAdapter.java:160) at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:793) at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:702) at org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoint.java:571) at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:644) at java.lang.Thread.run(Thread.java:534) 

This seems to be a MySQL error, anyways it seems I need to reduce some varchar sizes. Does any one know how to fix this particular example so that the table can be built and still be useable ?

[ The example is :
create table CMS_PROJECTRESOURCES (PROJECT_ID INT NOT NULL, RESOURCE_NAME VARCHAR(218) NOT NULL, primary key(PROJECT_ID, RESOURCE_NAME), index projectresource_resource_name (RESOURCE_NAME)) ]


Leighton


 --- On Fri 07/02, leightonbrown at excite.com < leightonbrown at excite.com > wrote:
From: leightonbrown at excite.com [mailto: leightonbrown at excite.com]
To: opencms-dev at opencms.org
Date: Fri,  2 Jul 2004 12:46:15 -0400 (EDT)
Subject: RE: AW: [opencms-dev] Illegal mix of collations error

<br>Hi,<br><br>I changed the key's value to ?useUnicode\=true&characterEncoding\=ISO-8859-1 which allowed me to complete the steps to import the workspace. However my /sites/default/resource folder is now empty for both online and offline projects. I don't think this is correct. I remember seeing so error about locales. Is there an installation log ? and do we require unicode to install the resources ?<br><br>Leighton<br><br><br> --- On Thu 07/01, Thomas Weckert < t.weckert at alkacon.com > wrote:<br>From: Thomas Weckert [mailto: t.weckert at alkacon.com]<br>To: opencms-dev at opencms.org<br>Date: Thu, 1 Jul 2004 12:24:12 +0200<br>Subject: AW: [opencms-dev] Illegal mix of collations error<br><br>Hi, that param gets set by the key mysql.constr.params in<br>webapp/setup/database/mysql/database.properties, which contains a set of<br>predefined key/value pair settings per db server.<br><br>Hth,<br>Thomas Weckert<br>Alkacon Software - The OpenCms Experts<br>http://www.alkacon.com <br><br><br>> -----Ursprüngliche Nachricht-----<br>> Von: opencms-dev-admin at opencms.org <br>> [mailto:opencms-dev-admin at opencms.org] Im Auftrag von <br>> leightonbrown at excite.com<br>> Gesendet: Mittwoch, 30. Juni 2004 23:33<br>> An: opencms-dev at opencms.org<br>> Betreff: RE: [opencms-dev] Illegal mix of collations error<br>> <br>> <br>> <br>> Hi,<br>> <br>> does anyone know where in source code the opencms.properties <br>> key : <br>> db.pool.default.jdbcUrl.params=?useUnicode\=true&characterEnco<br>> ding\=UTF-8<br>> gets set ?<br>> <br>> Leighton<br>> <br>> <br>> <br>>  --- On Wed 06/30, leightonbrown at excite.com < <br>> leightonbrown at excite.com > wrote:<br>> From: leightonbrown at excite.com [mailt<br> o: leightonbrown at excite.com]<br>> To: opencms-dev at opencms.org<br>> Date: Wed, 30 Jun 2004 08:10:37 -0400 (EDT)<br>> Subject: [opencms-dev] Illegal mix of collations error<br>> <br>> <br>Hi,<br><br>I'm using <br>opencms version: pre5.3.6dev Ix <br>> (from CVS)<br>tomcat : 5.0.25<br>mysql : 5.0.0<br>linux <br>> (kernel) : 2.6.7<br><br>I'm not able to import the workspace <br>> on initial setup. I get errors like - <br>103:	>>Root <br>> cause was: java.sql.SQLException: Illegal mix of collations <br>> (latin1_swedish_ci,IMPLICIT) and (utf8_general_ci,COERCIBLE) <br>> for operation '='<br>102:	<br>> >>org.opencms.main.CmsException: <br>> [org.opencms.db.mysql.CmsWorkflowDriver] where: <br>> org.opencms.db.generic.CmsWorkflowDriver.writeTaskType(CmsWork<br>> flowDriver.java:823), why: java.sql.SQLException: Illegal mix <br>> of collations (latin1_swedish_ci,IMPLICIT) and <br>> (utf8_general_ci,COERCIBLE) for operation '=' [Code 4 - Sql <br>> exception]<br><br>I've tried the mysql<br>  connector which came <br>> with opencms. ( mysql-connector-java-3.0.11-stable-bin.jar ), <br>> I've also tried the <br>> mysql-connector-java-3.0.14-production-bin.jar ,  <br>> mysql-connector-java-3.1.nightly-20040630-bin.jar , and <br>> <br>mysql-connector-java-3.1.2-alpha-bin.jar<br><br>without <br>> success.<br><br>Any ideas <br>><br>?<br><br>Leighton<br><br><br><br><br>___________________________________<br>____________> <br>Join Excite! - http://www.excite.com<br>The > most <br>> personalized portal on the <br>> Web!<br>_______________________________________________<br>Thi<br>> s mail is send to you from the opencms-dev mailing list<br>To <br>> change your list options, or to unsubscribe from the list, <br>> please <br>> visit<br>http://mail.opencms.org/mailman/listinfo/opencms-dev<br><br>> <br>> _______________________________________________<br>> Join Excite! - http://www.excite.com<br>> The most personalized portal on the Web! <br>> _______________________________<br> ________________<br>> This mail is send to you from the opencms-dev mailing list<br>> To change your list options, or to unsubscribe from the list, <br>> please visit http://mail.opencms.org/mailman/listinfo/opencms-dev<br>> <br>> <br><br>_______________________________________________<br>This mail is send to you from the opencms-dev mailing list<br>To change your list options, or to unsubscribe from the list, ple
 ase visit<br>http://mail.opencms.org/mailman/listinfo/opencms-dev<br><br><br>_______________________________________________<br>Join Excite! - http://www.excite.com<br>The most personalized portal on the Web!<br>_______________________________________________<br>This mail is send to you from the opencms-dev mailing list<br>To change your list options, or to unsubscribe from the list, please visit<br>http://mail.opencms.org/mailman/listinfo/opencms-dev<br>

_______________________________________________
Join Excite! - http://www.excite.com
The most personalized portal on the Web!



More information about the opencms-dev mailing list