mod_logdb: Could not connect to MySQL Server

Hi,

i have ejabberd 2.1.4 and try to run mog_logdb. But it can't connect to the MySQL Database (5.1.41).
I also tried it with MySQL 5.0.xx

erlang.log:

=CRASH REPORT==== 31-Jul-2010::20:12:30 ===
  crasher:
    pid: <0.407.0>
    registered_name: 'mod_logdb_mysql5_example.tld'
    exception exit: {undef,
                        [{mysql_conn,start,
                             ["localhost","3306","xxx","xxx",
                              "jabberlog",
                              [65536,131072],
                              #Fun<mod_logdb_mysql5.1.37672236>]},
                         {mod_logdb_mysql5,init,1},
                         {gen_server,init_it,6},
                         {proc_lib,init_p,5}]}
      in function  gen_server:init_it/6
    initial call: gen:init_it(gen_server,<0.406.0>,self,
                              {local,'mod_logdb_mysql5_example.tld'},
                              mod_logdb_mysql5,
                              ["example.tld",
                               [{user,"xxx"},
                                {password,"xxx"},
                                {server,"localhost"},
                                {port,"3306"},
                                {db,"jabberlog"}]],
                              [])
    ancestors: ['ejabberd_mod_logdb_example.tld',ejabberd_sup,<0.36.0>]
    messages: []
    links: []
    dictionary: []
    trap_exit: false
    status: running
    heap_size: 610
    stack_size: 23
    reductions: 215
  neighbours:

ejabberd.log:

=ERROR REPORT==== 2010-07-31 20:22:00 ===
E(<0.455.0>:mod_logdb:354) : Failed to start: {undef,
                                               [{mysql_conn,start,
                                                 ["localhost","3306",
                                                  "xxx","xxx",
                                                  "jabberlog",
                                                  [65536,131072],
                                                  #Fun<mod_logdb_mysql5.1.37672236>]},
                                                {mod_logdb_mysql5,init,1},
                                                {gen_server,init_it,6},
                                                {proc_lib,init_p,5}]}

=ERROR REPORT==== 2010-07-31 20:22:00 ===
** Generic server 'ejabberd_mod_logdb_example.tld' terminating
** Last message in was start
** When Server state == {state,"example.tld",mod_logdb_mysql5,undefined,
                            undefined,undefined,undefined,
                            [{user,"xxx"},
                             {password,"xxx"},
                             {server,"localhost"},
                             {port,"3306"},
                             {db,"jabberlog"}],
                            [{mysql5,
                                 [{user,"xxx"},
                                  {password,"xxx"},
                                  {server,"localhost"},
                                  {port,"3306"},
                                  {db,"jabberlog"}]}],
                            true,[],all,14,10,true}
** Reason for termination ==
** db_connection_failed

I tried the patched MySQL Driver, the newest from SVN and http://code.google.com/p/erlang-mysql-driver/

Can anyone help me?

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.

Seberoth wrote: Hi, i have

Seberoth wrote:

Hi,

i have ejabberd 2.1.4 and try to run mog_logdb. But it can't connect to the MySQL Database (5.1.41).
I also tried it with MySQL 5.0.xx

erlang.log:

    exception exit: {undef,
                        [{mysql_conn,start,
                             ["localhost","3306","xxx","xxx",
                              "jabberlog",
                              [65536,131072],
                              #Fun<mod_logdb_mysql5.1.37672236>]},
                         {mod_logdb_mysql5,init,1},
                         {gen_server,init_it,6},
                         {proc_lib,init_p,5}]}

I tried the patched MySQL Driver, the newest from SVN and http://code.google.com/p/erlang-mysql-driver/

Can anyone help me?

The error means that erlang couldn't find a file called mysql_conn.beam, or that the file was found but it doesn't export a function called start/7, where 7 is the 7 arguments that mod_logdb_mysql5 provided in that function call.

Now you can check all the different mysql_conn.erl versions that you have downloaded, and find one that contains something like this:

-export([start/7,
   ...

Once you find the proper mysql driver, compile it and install it (or copy it with all the other ejabberd *.beam files).

Ok. Now I use a

Ok. Now I use a mysql_conn.beam wirh start/7. But now i get the next error^^

=CRASH REPORT==== 5-Aug-2010::20:26:03 ===
  crasher:
    pid: <0.1244.0>
    registered_name: 'mod_logdb_mysql5_web-sim.de'
    exception exit: {function_clause,
                        [{mysql_conn,start,
                             ["localhost","3306","ejabberd","test",
                              "jabberlog",
                              [65536,131072],
                              #Fun<mod_logdb_mysql5.1.37672236>]},
                         {mod_logdb_mysql5,init,1},
                         {gen_server,init_it,6},
                         {proc_lib,init_p,5}]}
      in function  gen_server:init_it/6
    initial call: gen:init_it(gen_server,<0.1243.0>,self,
                              {local,'mod_logdb_mysql5_web-sim.de'},
                              mod_logdb_mysql5,
                              ["web-sim.de",
                               [{user,"ejabberd"},
                                {password,"test"},
                                {server,"localhost"},
                                {port,"3306"},
                                {db,"jabberlog"}]],
                              [])
    ancestors: ['ejabberd_mod_logdb_web-sim.de',ejabberd_sup,<0.850.0>]
    messages: []
    links: []
    dictionary: []
    trap_exit: false
    status: running
    heap_size: 610
    stack_size: 23
    reductions: 163
  neighbours:

The only differnce is the "exception exit: {function_clause".

Check your config

Seberoth wrote:

Ok. Now I use a mysql_conn.beam wirh start/7. But now i get the next error^^

    exception exit: {function_clause,
                        [{mysql_conn,start,
                             ["localhost","3306","ejabberd","test",
                              "jabberlog",
                              [65536,131072],
                              #Fun<mod_logdb_mysql5.1.37672236>]},
                         {mod_logdb_mysql5,init,1},

The only differnce is the "exception exit: {function_clause".

The function start wants the port to be an integer, like 3306, but you provided a string like "3306" (or maybe it's a bug in mod_logdb?).

Check your configuration file and replace "3306" with 3306.

Now its working. Thanks

Now its working. Thanks

Syndicate content