【问题标题】:failed to create table in openfire mysql database无法在 openfire mysql 数据库中创建表
【发布时间】:2019-05-03 07:22:09
【问题描述】:

我正在 mysql 中创建一个 openfire 数据库,但是当我尝试创建它时,它显示“似乎没有安装 Openfire 数据库架构。按照安装指南修复此错误。'。

日志

    2018.12.01 14:40:48 org.jivesoftware.database.SchemaManager - SchemaManager: Failed to execute SQL:
 CREATE TABLE ofRosterGroups (   rosterID              BIGINT          NOT NULL,   rank                  TINYINT         NOT NULL,   groupName             VARCHAR(255)     NULL,   PRIMARY KEY (rosterID, rank),   INDEX ofRosterGroup_rosterid_idx (rosterID) );
2018.12.01 14:40:48 org.jivesoftware.database.SchemaManager - 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 'rank                  TINYINT         NOT NULL,   groupName             VARCHAR(' at line 1
java.sql.SQLSyntaxErrorException: 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 'rank                  TINYINT         NOT NULL,   groupName             VARCHAR(' at line 1
    at com.mysql.cj.jdbc.exceptions.SQLError.createSQLException(SQLError.java:120)
    at com.mysql.cj.jdbc.exceptions.SQLError.createSQLException(SQLError.java:97)
    at com.mysql.cj.jdbc.exceptions.SQLExceptionsMapping.translateException(SQLExceptionsMapping.java:122)
    at com.mysql.cj.jdbc.StatementImpl.executeInternal(StatementImpl.java:781)
    at com.mysql.cj.jdbc.StatementImpl.execute(StatementImpl.java:666)
    at sun.reflect.GeneratedMethodAccessor12.invoke(Unknown Source)

每次创建 openfire 数据库表时都会出现此错误

任何帮助将不胜感激 提前致谢

【问题讨论】:

  • 这听起来更像是您的安装问题,而不是您的查询问题。其他表你成功制作了吗?
  • 不幸的是,我无法复制此错误sqlfiddle.com/#!9/9eecb
  • @JaredC 是的,我做到了,它卡在了 ofrostergroup 中

标签: mysql database xmpp openfire


【解决方案1】:
从 MySQL 8.0.2 开始,

'rank' 是一个保留关键字,它会导致此查询失败。 Openfire 版本 4.3.0 中提供了针对此问题的修复程序。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2013-10-01
    • 1970-01-01
    • 2014-12-31
    相关资源
    最近更新 更多