我在Windows机器上安装了Sonar 3.4.1和Mysql 5.6.10。在Windows上使用Sonar和MySQL 5.6的架构设置失败
我已经创建了一个mysql模式“声纳”,并授予它对用户“声纳”的所有权限。我已配置声纳使用此用户。我按照the codehaus sonar page上的说明执行此操作。
当启动声纳时,它开始在模式中创建表格。在某些时候出现错误,指出“指定的密钥太长;最大密钥长度是767字节”(最后是完整的错误信息)。
根据this question索引长度限制在mysql中。因为这是有记录的,我预计Sonar不会创建超过极限的索引。显然它试图这样做。
我有没有想过一些重要的配置,或者是sonar和mysql的两个版本incompatbile?我能做些什么来使它们适用于这些版本?
完整的错误消息:
INFO | jvm 1 | 2013/02/11 11:28:25 | INFO | jvm 1 | 2013/02/11 11:28:25 | == CreateProperties: migrating =============================================== INFO | jvm 1 | 2013/02/11 11:28:25 | -- create_table("properties") INFO | jvm 1 | 2013/02/11 11:28:25 | -> 0.0320s INFO | jvm 1 | 2013/02/11 11:28:25 | -> 0 rows INFO | jvm 1 | 2013/02/11 11:28:25 | -- add_index(:properties, :prop_key, {:name=>"properties_key"}) 2013.02.11 11:28:25 ERROR jruby.rack unable to create shared application instance org.jruby.rack.RackInitializationException: An error has occurred, all later migrations canceled: ActiveRecord::JDBCError: Specified key was too long; max key length is 767 bytes: CREATE INDEX `properties_key` ON `properties` (`prop_key`) from D:/Programs/sonar-3.4.1/war/sonar-server/WEB-INF/gems/gems/activerecord-jdbc-adapter-1.1.3/lib/arjdbc/jdbc/adapter.rb:183:in `execute' [stacktrace omitted] org.jruby.exceptions.RaiseException: (StandardError) An error has occurred, all later migrations canceled: ActiveRecord::JDBCError: Specified key was too long; max key length is 767 bytes: CREATE INDEX `properties_key` ON `properties` (`prop_key`) 2013.02.11 11:28:25 ERROR jruby.rack Error: application initialization failed org.jruby.rack.RackInitializationException: An error has occurred, all later migrations canceled: ActiveRecord::JDBCError: Specified key was too long; max key length is 767 bytes: CREATE INDEX `properties_key` ON `properties` (`prop_key`) from D:/Programs/sonar-3.4.1/war/sonar-server/WEB-INF/gems/gems/activerecord-jdbc-adapter-1.1.3/lib/arjdbc/jdbc/adapter.rb:183:in `execute' [stacktrace omitted] org.jruby.exceptions.RaiseException: (StandardError) An error has occurred, all later migrations canceled: ActiveRecord::JDBCError: Specified key was too long; max key length is 767 bytes: CREATE INDEX `properties_key` ON `properties` (`prop_key`) INFO | jvm 1 | 2013/02/11 11:28:25 | 2013-02-11 11:28:25.421:INFO::Started [email protected]:9000
用MySQL 5.5.30测试它,它工作。根据SONAR文档,支持任何MySQL 5.x。我创建了一个[JIRA问题](http://jira.codehaus.org/browse/SONAR-4137),并将继续更新此问题。 – 2013-02-11 14:15:00