玩! 2.4 和 evolutions 无法在 MySQL 数据库上部署
Play! 2.4 and evolutions fails to deploy on a MySQL database
我正在尝试部署 Play! 2.4项目,使用eBeans和Evolutions。
但是,当尝试在 MySQL 数据库上部署时,出现以下错误:
[error] p.a.d.e.DefaultEvolutionsApi - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'sequence donation_seq' at line 1 [ERROR:1064, SQLSTATE:42000]
Oops, cannot start the server.
@6ocm6hnl7: Database 'default' is in an inconsistent state!
at play.api.db.evolutions.DatabaseEvolutions.checkEvolutionsState(EvolutionsApi.scala:269)
at play.api.db.evolutions.DatabaseEvolutions.evolve(EvolutionsApi.scala:226)
at play.api.db.evolutions.DefaultEvolutionsApi.evolve(EvolutionsApi.scala:81)
at play.api.db.evolutions.ApplicationEvolutions$$anonfun$play$api$db$evolutions$ApplicationEvolutions$$runEvolutions.apply$mcV$sp(ApplicationEvolutions.scala:62)
at play.api.db.evolutions.ApplicationEvolutions.withLock(ApplicationEvolutions.scala:98)
at play.api.db.evolutions.ApplicationEvolutions.play$api$db$evolutions$ApplicationEvolutions$$runEvolutions(ApplicationEvolutions.scala:49)
at play.api.db.evolutions.ApplicationEvolutions$$anonfun$start.apply(ApplicationEvolutions.scala:42)
at play.api.db.evolutions.ApplicationEvolutions$$anonfun$start.apply(ApplicationEvolutions.scala:42)
at scala.collection.immutable.List.foreach(List.scala:381)
at play.api.db.evolutions.ApplicationEvolutions.start(ApplicationEvolutions.scala:42)
at play.api.db.evolutions.ApplicationEvolutions.<init>(ApplicationEvolutions.scala:149)
at play.api.db.evolutions.ApplicationEvolutionsProvider.get$lzycompute(EvolutionsModule.scala:53)
at play.api.db.evolutions.ApplicationEvolutionsProvider.get(EvolutionsModule.scala:53)
at play.api.db.evolutions.ApplicationEvolutionsProvider.get(EvolutionsModule.scala:44)
at com.google.inject.internal.ProviderInternalFactory.provision(ProviderInternalFactory.java:81)
at com.google.inject.internal.BoundProviderFactory.provision(BoundProviderFactory.java:72)
at com.google.inject.internal.ProviderInternalFactory.circularGet(ProviderInternalFactory.java:61)
at com.google.inject.internal.BoundProviderFactory.get(BoundProviderFactory.java:62)
at com.google.inject.internal.ProviderToInternalFactoryAdapter.call(ProviderToInternalFactoryAdapter.java:46)
at com.google.inject.internal.InjectorImpl.callInContext(InjectorImpl.java:1103)
at com.google.inject.internal.ProviderToInternalFactoryAdapter.get(ProviderToInternalFactoryAdapter.java:40)
at com.google.inject.internal.SingletonScope.get(SingletonScope.java:145)
at com.google.inject.internal.InternalFactoryToProviderAdapter.get(InternalFactoryToProviderAdapter.java:41)
at com.google.inject.internal.InternalInjectorCreator.call(InternalInjectorCreator.java:205)
at com.google.inject.internal.InternalInjectorCreator.call(InternalInjectorCreator.java:199)
at com.google.inject.internal.InjectorImpl.callInContext(InjectorImpl.java:1092)
at com.google.inject.internal.InternalInjectorCreator.loadEagerSingletons(InternalInjectorCreator.java:199)
at com.google.inject.internal.InternalInjectorCreator.injectDynamically(InternalInjectorCreator.java:180)
at com.google.inject.internal.InternalInjectorCreator.build(InternalInjectorCreator.java:110)
at com.google.inject.Guice.createInjector(Guice.java:96)
at com.google.inject.Guice.createInjector(Guice.java:73)
at com.google.inject.Guice.createInjector(Guice.java:62)
at play.api.inject.guice.GuiceBuilder.injector(GuiceInjectorBuilder.scala:126)
at play.api.inject.guice.GuiceApplicationBuilder.build(GuiceApplicationBuilder.scala:93)
at play.api.inject.guice.GuiceApplicationLoader.load(GuiceApplicationLoader.scala:21)
at play.core.server.ProdServerStart$.start(ProdServerStart.scala:52)
at play.core.server.ProdServerStart$.main(ProdServerStart.scala:27)
at play.core.server.ProdServerStart.main(ProdServerStart.scala)
我该如何解决这个问题?
我是否必须在某处指定我将使用 MySQL 数据库进行生产,以便创建与 MySQL 兼容的 SQL 语法?
我确实将 H2 设置为 MYSQL 模式:db.default.url="jdbc:h2:mem:play;MODE=MYSQL"
使用 mySql 作为我的开发数据库并升级到版本 5.6(5.5 不接受 DateTime(6))解决了这个问题。
我正在尝试部署 Play! 2.4项目,使用eBeans和Evolutions。
但是,当尝试在 MySQL 数据库上部署时,出现以下错误:
[error] p.a.d.e.DefaultEvolutionsApi - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'sequence donation_seq' at line 1 [ERROR:1064, SQLSTATE:42000]
Oops, cannot start the server.
@6ocm6hnl7: Database 'default' is in an inconsistent state!
at play.api.db.evolutions.DatabaseEvolutions.checkEvolutionsState(EvolutionsApi.scala:269)
at play.api.db.evolutions.DatabaseEvolutions.evolve(EvolutionsApi.scala:226)
at play.api.db.evolutions.DefaultEvolutionsApi.evolve(EvolutionsApi.scala:81)
at play.api.db.evolutions.ApplicationEvolutions$$anonfun$play$api$db$evolutions$ApplicationEvolutions$$runEvolutions.apply$mcV$sp(ApplicationEvolutions.scala:62)
at play.api.db.evolutions.ApplicationEvolutions.withLock(ApplicationEvolutions.scala:98)
at play.api.db.evolutions.ApplicationEvolutions.play$api$db$evolutions$ApplicationEvolutions$$runEvolutions(ApplicationEvolutions.scala:49)
at play.api.db.evolutions.ApplicationEvolutions$$anonfun$start.apply(ApplicationEvolutions.scala:42)
at play.api.db.evolutions.ApplicationEvolutions$$anonfun$start.apply(ApplicationEvolutions.scala:42)
at scala.collection.immutable.List.foreach(List.scala:381)
at play.api.db.evolutions.ApplicationEvolutions.start(ApplicationEvolutions.scala:42)
at play.api.db.evolutions.ApplicationEvolutions.<init>(ApplicationEvolutions.scala:149)
at play.api.db.evolutions.ApplicationEvolutionsProvider.get$lzycompute(EvolutionsModule.scala:53)
at play.api.db.evolutions.ApplicationEvolutionsProvider.get(EvolutionsModule.scala:53)
at play.api.db.evolutions.ApplicationEvolutionsProvider.get(EvolutionsModule.scala:44)
at com.google.inject.internal.ProviderInternalFactory.provision(ProviderInternalFactory.java:81)
at com.google.inject.internal.BoundProviderFactory.provision(BoundProviderFactory.java:72)
at com.google.inject.internal.ProviderInternalFactory.circularGet(ProviderInternalFactory.java:61)
at com.google.inject.internal.BoundProviderFactory.get(BoundProviderFactory.java:62)
at com.google.inject.internal.ProviderToInternalFactoryAdapter.call(ProviderToInternalFactoryAdapter.java:46)
at com.google.inject.internal.InjectorImpl.callInContext(InjectorImpl.java:1103)
at com.google.inject.internal.ProviderToInternalFactoryAdapter.get(ProviderToInternalFactoryAdapter.java:40)
at com.google.inject.internal.SingletonScope.get(SingletonScope.java:145)
at com.google.inject.internal.InternalFactoryToProviderAdapter.get(InternalFactoryToProviderAdapter.java:41)
at com.google.inject.internal.InternalInjectorCreator.call(InternalInjectorCreator.java:205)
at com.google.inject.internal.InternalInjectorCreator.call(InternalInjectorCreator.java:199)
at com.google.inject.internal.InjectorImpl.callInContext(InjectorImpl.java:1092)
at com.google.inject.internal.InternalInjectorCreator.loadEagerSingletons(InternalInjectorCreator.java:199)
at com.google.inject.internal.InternalInjectorCreator.injectDynamically(InternalInjectorCreator.java:180)
at com.google.inject.internal.InternalInjectorCreator.build(InternalInjectorCreator.java:110)
at com.google.inject.Guice.createInjector(Guice.java:96)
at com.google.inject.Guice.createInjector(Guice.java:73)
at com.google.inject.Guice.createInjector(Guice.java:62)
at play.api.inject.guice.GuiceBuilder.injector(GuiceInjectorBuilder.scala:126)
at play.api.inject.guice.GuiceApplicationBuilder.build(GuiceApplicationBuilder.scala:93)
at play.api.inject.guice.GuiceApplicationLoader.load(GuiceApplicationLoader.scala:21)
at play.core.server.ProdServerStart$.start(ProdServerStart.scala:52)
at play.core.server.ProdServerStart$.main(ProdServerStart.scala:27)
at play.core.server.ProdServerStart.main(ProdServerStart.scala)
我该如何解决这个问题? 我是否必须在某处指定我将使用 MySQL 数据库进行生产,以便创建与 MySQL 兼容的 SQL 语法?
我确实将 H2 设置为 MYSQL 模式:db.default.url="jdbc:h2:mem:play;MODE=MYSQL"
使用 mySql 作为我的开发数据库并升级到版本 5.6(5.5 不接受 DateTime(6))解决了这个问题。