我正在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 db表时,每次都会出现此错误

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

最佳答案

从MySQL 8.0.2开始,'rank'是一个保留关键字,导致此查询失败。 Openfire的4.3.0版本已提供了针对此问题的修复程序。

关于mysql - 无法在openfire mysql数据库中创建表,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/53569357/

10-12 01:16
查看更多