简体   繁体   中英

Unable to connect Mysql with Ejabberd - failed to start application 'p1_mysql'

I started working on ejabberd recently and ran into a problem while connecting with mysql.

I had installed ejabberd using the command line on Ubuntu - sudo apt-get install ejabberd I had referenced the following tutorial for setting up ejabberd - Install ejabberd on Ubuntu

Now, in order to connect to Mysql I have done the following changes in ejabberd.yml -

auth_method: odbc
odbc_type: mysql
odbc_server: "localhost"
odbc_database: "ejabberd"
odbc_username: "ejabberd"
odbc_password: "password"
##
## If you want to specify the port:
odbc_port: 3306

But on restarting the service, I get this error

[critical] <0.38.0>@ejabberd:exit_or_halt:133 failed to start application 'p1_mysql': {error,
                                         {"no such file or directory",
                                          "p1_mysql.app"}}

I saw a few links where it was mentioned to use ./configure --enable-odbc --enable-mysql to solve this issue(works when you install ejabberd by compiling the source), but since I have not compiled the source code to install ejabberd (like I mentioned above), I am unable to do this. How do I solve this issue. Thanks in advance.

To use ejabberd with Mysql in Ubuntu you need to install the erlang-p1-mysql package:

sudo apt install erlang-p1-mysql

I had the same issue and that solved it.

Compile it from source and put resulting p1_mysql* files in the installed ejabberd's ebin directory, eg:

$ ./configure --enable-mysql
$ make
$ cp deps/p1_mysql/ebin/* /path/to/running/ejabberd/ebin/

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM