玩框架MySQL和EBean

时间:2014-11-25 10:27:04

标签: mysql playframework playframework-2.0 ebean

所以我试图在我的服务器上部署我的Play Framework 2.3.5。我已将其与MySQL数据库(最新版本)连接,并使用EBean进行持久化。

我的1.sql脚本如下所示:

# --- Created by Ebean DDL
# To stop Ebean DDL generation, remove this comment and start using Evolutions

# --- !Ups

create table input (
  id                        varchar(255) not null auto_increment,
  text                      TEXT not null,
  mode                      varchar(255) not null,
  theme                     varchar(255) not null,
  title                     varchar(255) not null,
  PRIMARY KEY (id)
)
;




# --- !Downs

drop table input;

因为我发布了我的错误消息:

[info] play - database [default] connected at jdbc:mysql://localhost/pastedemo
[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 input_seq' at line 1 [ERROR:1064, SQLSTATE:42000]
Oops, cannot start the server.
@6kaijj99g: Database 'default' is in an inconsistent state!

有人能告诉我我的错吗? :)

1 个答案:

答案 0 :(得分:0)

好的我解决了这个问题。这很容易。

如果要在生产模式下使用应用程序,则必须删除1.sql。然后使用activator dist打包您的应用程序并将其上传到您的服务器上。 请勿再次使用run进行测试。之后您可以部署它并且可以正常运行。