我的问题是部署服务器上的播放数据库演变一次又一次处于不一致状态。我不明白有什么问题。
- 所有测试工作正常(在内存中)
- 我可以使用 run 启动应用程序(在内存中)
- 我删除了进化sql脚本并让它重新生成(通过点击浏览器进化触发器)
- 我在 conf 文件中为 mysql 访问切换了必要的属性
- 我开始构建
play clean compile stage
- 我删除并创建 mysql 数据库
- 然后我用 -DapplyEvolutions.default=true 启动应用程序
我经常得到这个错误:
[error] play - 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 life_cycle_event_seq' at line 1 [ERROR:1064, SQLSTATE:42000]
Oops, cannot start the server.
@6epm5i5m6: Database 'default' is in inconsistent state!
at play.api.db.evolutions.Evolutions$.checkEvolutionsState(Evolutions.scala:177)
at play.api.db.evolutions.Evolutions$.applyScript(Evolutions.scala:275)
at play.api.db.evolutions.EvolutionsPlugin$$anonfun$onStart$1$$anonfun$apply$1.apply$mcV$sp(Evolutions.scala:446)
at play.api.db.evolutions.EvolutionsPlugin.withLock(Evolutions.scala:483)
at play.api.db.evolutions.EvolutionsPlugin$$anonfun$onStart$1.apply(Evolutions.scala:439)
at play.api.db.evolutions.EvolutionsPlugin$$anonfun$onStart$1.apply(Evolutions.scala:437)
at scala.collection.immutable.List.foreach(List.scala:309)
at play.api.db.evolutions.EvolutionsPlugin.onStart(Evolutions.scala:437)
at play.api.Play$$anonfun$start$1$$anonfun$apply$mcV$sp$1.apply(Play.scala:63)
at play.api.Play$$anonfun$start$1$$anonfun$apply$mcV$sp$1.apply(Play.scala:63)
at scala.collection.immutable.List.foreach(List.scala:309)
at play.api.Play$$anonfun$start$1.apply$mcV$sp(Play.scala:63)
at play.api.Play$$anonfun$start$1.apply(Play.scala:63)
at play.api.Play$$anonfun$start$1.apply(Play.scala:63)
at play.utils.Threads$.withContextClassLoader(Threads.scala:18)
at play.api.Play$.start(Play.scala:62)
at play.core.StaticApplication.<init>(ApplicationProvider.scala:54)
at play.core.server.NettyServer$.createServer(NettyServer.scala:228)
at play.core.server.NettyServer$$anonfun$main$5.apply(NettyServer.scala:259)
at play.core.server.NettyServer$$anonfun$main$5.apply(NettyServer.scala:258)
at scala.Option.map(Option.scala:145)
at play.core.server.NettyServer$.main(NettyServer.scala:258)
at play.core.server.NettyServer.main(NettyServer.scala)
在玩弄了整个过程之后,它突然起作用了。