我在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