我正在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)
每次创建openfiredb表时都会出现此错误
如有任何帮助,我们将不胜感激
1条答案
按热度按时间ekqde3dh1#
从mysql 8.0.2开始,“rank”是一个保留关键字,它会导致此查询失败。openfire的4.3.0版本中提供了此问题的修复程序。