1

如何在 mysql 数据库中查看我的 liferay 表?我已经在liferay home.中创建了portal-ext.properties。但是我看不到我的liferey 表mySql.. 表是在eclipse IDE 的docroot/web-inf/sql 中创建的...帮助我哪里错了,缺少什么?

#
# MySQL 
#
include-and-override=portal-ext.properties
include-and-override=${liferay.home}/portal-ext.properties

jdbc.default.driverClassName=com.mysql.jdbc.Driver 
jdbc.default.url=jdbc:mysql://localhost/kportal?useUnicode=true&characterEn
coding=UTF-8&useFastDateParsing=false
jdbc.default.username=root
jdbc.default.password=ubuntu123
schema.run.enabled=true
schema.run.minimal=true
4

1 回答 1

1

通过 service-builder 创建的表只会在您将插件部署到实际服务器(并运行服务器)后创建,而不是在构建时创建。此外,您的插件需要正确部署 - 如果初始化失败(例如,由于缺少部分或未满足的依赖关系),将不会创建表。

此外,默认情况下,表将使用您提供的命名空间作为前缀命名。因此,如果您声明一个命名空间 X(在 service.xml 中)和一个名为 Y 的实体,则要查找的表将命名为 X_Y。

另外,请记住,您必须ant build-services在编辑 service.xml 后运行。然后部署它并等待类似“...您的插件...可供使用”的日志消息,以确保它正确部署。(编辑:这不再为 portlet 打印,仅针对其他插件类型,因此在部署插件时您可能看不到它)

如果这没有帮助,请提供更多信息。目前,您没有提供有关您实际尝试过的任何细节。您将在开发指南中找到更多步骤和详细信息。

另外,请确保

  • that the account you use for the database has CREATE TABLE permissions (you use root in your configuration above - that should do the trick)
  • that you're checking the correct database in case you have multiple
  • that Liferay actually picks up your configuration file. The startup log will tell you which portal-ext.properties files are read, as well as which database it will use. In case you can't find the name/location of your portal-ext.properties file, make sure that you indeed have a file with this name. A common problem on windows is that people create portal-ext.properties.txt (and Windows hides the .txt part of the name)
于 2013-04-01T09:14:53.317 回答