Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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.

like image 544
ayan_2587 Avatar asked Jan 05 '23 21:01

ayan_2587


2 Answers

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.

like image 87
mancho Avatar answered Jan 08 '23 10:01

mancho


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

$ ./configure --enable-mysql
$ make
$ cp deps/p1_mysql/ebin/* /path/to/running/ejabberd/ebin/
like image 20
user2610053 Avatar answered Jan 08 '23 11:01

user2610053