ejabberd 16.06 + mysql 5.5.50,不保存消息历史

2021-11-17 00:00:00 message mysql history archive ejabberd

我用的是ejabberd 16.06 + mysql 5.5.50,消息历史没有保存.

I use ejabberd 16.06 + mysql 5.5.50, message history is not saved.

我的 ejabberd.yml:

My ejabberd.yml:

## MySQL server:

odbc_type: mysql 
odbc_server: "freldo"
odbc_port: 3306
odbc_database: "ejabberd"
odbc_username: "ejabberd" 
odbc_password: "ejabberd"

modules: 
... 
mod_mam: 
   db_type: odbc 
   default: always

为了形成数据库结构,我使用了:mysql.sql

for the formation of the database structure, I used: mysql.sql

我收到一个错误:

@ejabberd_sql:check_error:1039 SQL 查询 'SELECT 时间戳,xml,peer,
kind, nick FROM (SELECT 时间戳, xml, peer, kind, nick FROM archive
WHERE username='test' 和bare_peer='misha@freldo' 按时间戳排序
DESC 限制 21) AS t ORDER BY 时间戳 ASC;'失败:#42S22Unknown
字段列表"中的种类"列"

@ejabberd_sql:check_error:1039 SQL query 'SELECT timestamp, xml, peer,
kind, nick FROM (SELECT timestamp, xml, peer, kind, nick FROM archive
WHERE username='test' and bare_peer='misha@freldo' ORDER BY timestamp
DESC limit 21) AS t ORDER BY timestamp ASC;' failed: "#42S22Unknown
column 'kind' in 'field list'"

我没有在数据库中保存消息历史.

I have not saved message history in database.

推荐答案

将您的 mysql 升级到 5.6+ 版本应该可以解决您的问题.

Upgrading your mysql to version 5.6+ should solve your problem.

ejabberd 在 InnoDB 中使用 FULLTEXT 索引.因此,你需要MySQL 5.6 或更高版本与 ejabberd 一起使用.

ejabberd make use of FULLTEXT indexes with InnoDB. Thus, you need MySQL 5.6 or greater to use with ejabberd.

注意:如果您不将消息存档存储在数据库中,则可以尝试使用较旧的 5.5 版本.您可能需要适配 MySQL 数据库架构以应对那些较旧的 MySQL 版本.

Note: If you do not store message archive in database however, you can try using older 5.5 version. You may need to adapt MySQL database schema to cope with those older MySQL versions.

MySQL 5.6.4 或更高版本是 推荐 如果您想存储消息历史记录.

MySQL version 5.6.4 or higher is recommended if you want to store message history.

相关文章