How to check the Mesia ejabberd database

I want to access the ejabberd server’s Mnesia database, but I don’t know how to read, write and update data. Is there a way I can do this. Can I change the database to MySQL and not to Mnesia. I tried this

{odbc_server, {mysql, "localhost", "xmpp_db", "root", "**********"}}. 

Here, "xmpp_db" is the name of my database that was created for ejabberd, but I do not see any changes to xmpp_db. Should I create any tables in "xmpp_db", but the problem is what are the names of my tables and fields. I also used

ejabberdctl dump /tmp/ejabberd.db.txt 

but it’s easy to read data (data is in a very rough format and hard to understand). Is there a way by which I can perform read, write, and update operations in the Mnesia database.

Your help will be greatly appreciated.

+4
source share
2 answers

You really can use MySQL. As described in the documentation, you need to configure a connection to MySQL and decide which module will use it.

You can read the doc here: http://docs.ejabberd.im/admin/guide/configuration/#database-and-ldap-configuration

And they need to configure the back-end / method for the corresponding module. For example, for authentication, you need to set auth_method in odbc:

auth_method: odbc

+2
source

Is there any way I can perform read, write, and update operations in a Mnesia database?

General information:

Using ejabberdctl, you can get a list of Mnesia general information, tables, records, its file directory, etc.

$ ejabberdctl mnesia [info]

Data Manipulation:

Mnesia - ejabberd mnesia:dirty_read/2 .

$ ejabberdctl debug
1> mnesia:dirty_read(passwd, {<<"username">>, <<"host">>}).
[{passwd,{<<"username">>,<<"host">>}, <<"password">>}]

( ) Mnesia mnesia:dirty_write/2 .

$ ejabberdctl debug
1> mnesia:dirty_write({passwd, {<<"user">>, <<"host">>, <<"new-pass">>}).
ok

API Mnesia .

+2

All Articles