简体   繁体   English

如何使用Play框架访问phpmyadmin数据库

[英]How to access phpmyadmin database with play framework

I have created some mysql databases in mysql. 我已经在mysql中创建了一些mysql数据库。 Now I am trying to get them into my web application by using the play framework. 现在,我试图通过使用play框架将它们引入我的Web应用程序。

I added the mysql configs in the application.conf, added the dependency for the mysql driver in the build.sbt, created my first model and added the models packages as the ebean default in the application.conf. 我在application.conf中添加了mysql配置,在build.sbt中添加了mysql驱动程序的依赖关系,创建了我的第一个模型,并在application.conf中添加了模型包作为ebean的默认值。

Now when I go into my browser I get this error: 现在,当我进入浏览器时,出现以下错误:

错误

I`ma little confused right now, because I do not want to create a new table, but use the one I created already. 我现在有点困惑,因为我不想创建一个新表,而是使用我已经创建的表。

Any idea what I am doing wrong?? 知道我在做什么错吗?

Play's default behaviour during development is to manage your database via the evolutions plugin. Play在开发期间的默认行为是通过Evolutions插件管理数据库 You define your initial schema in conf/evolutions/default/1.sql and then apply subsequent modifications in 2.sql , 3.sql etc etc. Whenever there are changes to these evolution files the plugin will attempt to run these on the database, which is what you're seeing here (although it looks like an error, it's really just trying to be helpful.) 您可以在conf/evolutions/default/1.sql定义您的初始架构,然后在2.sql3.sql等中应用后续修改。每当对这些Evolution文件进行更改时,插件都会尝试在数据库上运行这些文件,这就是您在此处看到的内容(尽管它看起来像是一个错误,但实际上只是在试图提供帮助。)

If you want to manage the schema yourself (and you probably should on a production DB, for example) add evolutionplugin=disabled to the application.conf file. 如果要自己管理模式(例如,可能应该在生产数据库上),则将evolutionplugin=disabled添加到application.conf文件。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM