Config ejabberd under Ubuntu 13.04 to use mysql

I wrote this guide on how to config ejabberd under Ubuntu 13.04 to use mysql because there was little to no (updated) info out there so if someone want to do the same they will not have to find the solution by trial and error.

Ok so how do you config ejabberd to use. That is relatively easy.

Comment out this line.

{auth_method, internal}.

And remove the commants on this line and add your info

{auth_method, odbc}.

{odbc_server, {mysql, "localhost", “database-name”, "database-user", "database-password"}}.

Don’t try to restart ejabberd this is what I tried to do here and it locked itself in a sort of undead stat. I had to reboot the machine to get it to start again.

The problem is that the repository for ubuntu does not have the modules compiled for mysql use in ejabberd. fortunately someone kind had compiled it and uploaded a deb file for you to just install.

http://stefan-strigler.de/2009/01/14/ejabberd-mysql-drivers-for-debian-and-ubuntu/

Next you need the scheme for the database (ejabberd will not generate the table themselves). All links I found was outdated but when I looked in the git repository it was fairly easy to find. Here is the link.

https://github.com/processone/ejabberd/blob/master/sql/mysql.sql

Almost done now you need to add the admin user like normal setup.

Run this command and change it to your values.

sudo ejabberdctl register admin localhost password

Then change this to the user you created

{acl, admin, {user, "admin", "localhost"}}. 

{hosts, ["localhost"]}.

Last restart ejabberd

 sudo service ejabberd restart

You are now done.

If any of the links are down I made mirrors of them here

ejabberd-mysql-20090114_1-2_all

mysql

Leave a Reply

Your email address will not be published.

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>