Author Topic: MySQL creation fails with "max key length is 1000 bytes"  (Read 5716 times)

ricksebak

  • Newbie
  • *
  • Posts: 4
  • Karma: 0
    • View Profile
    • Email
MySQL creation fails with "max key length is 1000 bytes"
« on: September 27, 2015, 17:55:30 »
I'm using a FreePBX virtual appliance, and I installed wombat via "yum install wombat", which went fine. I went to myserver:8080/wombat, and attempted to do the MySQL setup, but it fails with the following error. Does anybody know how to fix this?

Scientific Linux
MySQL 5.1


Error:-- Inner Exception -- Exception: it.loway.tpf.common.exceptions.TechException Stack trace: Database issue: Database error: -- Inner Exception -- Exception: com.mysql.jdbc.exceptions.MySQLSyntaxErrorException Error: Specified key was too long; max key length is 1000 bytes Stack trace: com.mysql.jdbc.exceptions.MySQLSyntaxErrorException: Specified key was too long; max key length is 1000 bytes at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:936) at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:2985) at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:1631) at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:1723) at com.mysql.jdbc.Connection.execSQL(Connection.java:3277) at com.mysql.jdbc.Connection.execSQL(Connection.java:3206) at com.mysql.jdbc.Statement.execute(Statement.java:727) at it.loway.tpf.SQL.execSql(SQL.java:108) at ch.loway.tpf.dbcreator.dbtest.dbCreate.UploadDatabase.doUpdate(UploadDatabase.java:47) at ch.loway.tpf.dbcreator.dbtest.BaseSchemaUpdater.doUpdate(BaseSchemaUpdater.java:81) at ch.loway.tpf.dbcreator.dbtest.BaseSchemaUpdater.runSingleUpdater(BaseSchemaUpdater.java:158) at ch.loway.tpf.dbcreator.dbtest.BaseSchemaUpdater.runSingleUpdater(BaseSchemaUpdater.java:143) at org.apache.jsp.dbtest.SchemaUpdater_005fajax_jsp._jspService(SchemaUpdater_005fajax_jsp.java:138) at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70) at javax.servlet.http.HttpServlet.service(HttpServlet.java:717) at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:388) at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:313) at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:260) at javax.servlet.http.HttpServlet.service(HttpServlet.java:717) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109) at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:291) at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:859) at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:602) at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:489) at java.lang.Thread.run(Thread.java:662) -- End Inner Exception -- When running: CREATE TABLE `dbversion` ( `version_id` int(11) NOT NULL, `lic_version` varchar(255) NOT NULL, `lic_approved` varchar(255) NOT NULL, `plex_id` varchar(255) NOT NULL, PRIMARY KEY (`version_id`,`lic_version`,`lic_approved`,`plex_id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 at it.loway.tpf.SQL.execSql(SQL.java:113) at ch.loway.tpf.dbcreator.dbtest.dbCreate.UploadDatabase.doUpdate(UploadDatabase.java:47) at ch.loway.tpf.dbcreator.dbtest.BaseSchemaUpdater.doUpdate(BaseSchemaUpdater.java:81) at ch.loway.tpf.dbcreator.dbtest.BaseSchemaUpdater.runSingleUpdater(BaseSchemaUpdater.java:158) at ch.loway.tpf.dbcreator.dbtest.BaseSchemaUpdater.runSingleUpdater(BaseSchemaUpdater.java:143) at org.apache.jsp.dbtest.SchemaUpdater_005fajax_jsp._jspService(SchemaUpdater_005fajax_jsp.java:138) at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70) at javax.servlet.http.HttpServlet.service(HttpServlet.java:717) at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:388) at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:313) at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:260) at javax.servlet.http.HttpServlet.service(HttpServlet.java:717) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109) at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:291) at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:859) at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:602) at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:489) at java.lang.Thread.run(Thread.java:662) -- End Inner Exception --   

QueueMetrics

  • Loway
  • Hero Member
  • *
  • Posts: 2999
  • Karma: 39
    • View Profile
    • QueueMetrics
Re: MySQL creation fails with "max key length is 1000 bytes"
« Reply #1 on: September 28, 2015, 14:01:29 »
I think that you need a newer version of MySQL, like 5.5, and possibly set:

Quote
innodb_large_prefix

Introduced   5.5.14
Command-Line Format   --innodb_large_prefix
System Variable   Name   innodb_large_prefix
Variable Scope   Global
Dynamic Variable   Yes
Permitted Values   Type   boolean
Default   OFF
Enable this option to allow index key prefixes longer than 767 bytes (up to 3072 bytes), for InnoDB tables that use the DYNAMIC and COMPRESSED row formats. (Creating such tables also requires the option values innodb_file_format=barracuda and innodb_file_per_table=true.) See Section 14.8.7, “Limits on InnoDB Tables” for the relevant maximums associated with index key prefixes under various settings.

For tables using the REDUNDANT and COMPACT row formats, this option does not affect the allowed key prefix length. It does introduce a new error possibility. When this setting is enabled, attempting to create an index prefix with a key length greater than 3072 for a REDUNDANT or COMPACT table causes an ER_INDEX_COLUMN_TOO_LONG error.

santi.anton

  • Newbie
  • *
  • Posts: 3
  • Karma: 0
    • View Profile
    • Email
Re: MySQL creation fails with "max key length is 1000 bytes"
« Reply #2 on: May 12, 2017, 16:23:14 »
There isn't any chance to install wombat in a Centos 6.7 with MySQL 5.1? I'm having the same error when wombat installer tries to insert wombat database tables.

Thanks in advance,

santi.anton

  • Newbie
  • *
  • Posts: 3
  • Karma: 0
    • View Profile
    • Email
Re: MySQL creation fails with "max key length is 1000 bytes"
« Reply #3 on: May 15, 2017, 18:12:06 »
Wombat perfectly works with MySQL 5.1. In my case, the problem was the innodb module, there was "skip-innodb" in /etc/my.cnf.

Hope this will help.



QueueMetrics

  • Loway
  • Hero Member
  • *
  • Posts: 2999
  • Karma: 39
    • View Profile
    • QueueMetrics
Re: MySQL creation fails with "max key length is 1000 bytes"
« Reply #4 on: June 26, 2018, 13:22:28 »
InndoDB is mandatory for Wombat, so it will not work without it.