ejabberd - Comments for "mod_logdb: Could not connect to MySQL Server" https://www.ejabberd.im/node/4183 en Seberoth, Can you please https://www.ejabberd.im/node/4183#comment-58527 <p>Seberoth,<br /> Can you please elaborate - what is the version of ejabberd you got it to work on and where you found the mysql_conn.erl source file with "start/7"? I only find source files with "start/6".<br /> I actually found one that has "start/7" but it breaks big time, here're some excerpts from the ejabberd log file:<br /> ==============================<br /> =INFO REPORT==== 2012-04-11 14:53:40 ===<br /> I(&lt;0.264.0&gt;:mod_logdb_mysql5:142) : Opening mysql connection root@server.localdomain:3306/db123</p> <p>=ERROR REPORT==== 2012-04-11 14:53:40 ===<br /> Error in process &lt;0.266.0&gt; on node 'ejabberd@localhost' with exit value: {function_clause,[{mysql_conn,do_recv,[[65536,131072],&lt;0.268.0&gt;,undefined]},{mysql_conn,mysql_init,5},{mysql_conn,init,8}]}</p> <p>...</p> <p>=ERROR REPORT==== 2012-04-11 14:53:45 ===<br /> E(&lt;0.264.0&gt;:mod_logdb_mysql5:127) : MySQL connection failed: "timed out"</p> <p>==============================</p> <p>Looking at mysql query logs, it doesn't issue any commands to my mysql server, not even authentication; netstat shows "TIME_WAIT" but never actually goes into "ESTABLISHED" for (ejabberd) &lt;---&gt; (mysql server) connection<br /> I don't know any erlang so I'm at loss here. Any help/clues would be greatly appreciated.</p> Wed, 11 Apr 2012 23:02:29 +0000 rumcho comment 58527 at https://www.ejabberd.im Now its working. Thanks https://www.ejabberd.im/node/4183#comment-56541 <p>Now its working. Thanks</p> Wed, 25 Aug 2010 16:11:26 +0000 Seberoth comment 56541 at https://www.ejabberd.im Check your config https://www.ejabberd.im/node/4183#comment-56501 <div class="quote-msg"> <div class="quote-author"><em>Seberoth</em> wrote:</div> <p>Ok. Now I use a mysql_conn.beam wirh start/7. But now i get the next error^^</p> <div class="codeblock"><code>&nbsp;&nbsp;&nbsp; exception exit: {function_clause,<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;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p;&nbsp;&nbsp; {mod_logdb_mysql5,init,1},</code></div> <p>The only differnce is the "exception exit: {function_clause".</p></div> <p>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?).</p> <p>Check your configuration file and replace "3306" with 3306.</p> Wed, 11 Aug 2010 17:23:05 +0000 mfoss comment 56501 at https://www.ejabberd.im Ok. Now I use a https://www.ejabberd.im/node/4183#comment-56482 <p>Ok. Now I use a mysql_conn.beam wirh start/7. But now i get the next error^^</p> <div class="codeblock"><code>=CRASH REPORT==== 5-Aug-2010::20:26:03 ===<br />&nbsp; crasher:<br />&nbsp;&nbsp;&nbsp; pid: &lt;0.1244.0&gt;<br />&nbsp;&nbsp;&nbsp; registered_name: &#039;mod_logdb_mysql5_web-sim.de&#039;<br />&nbsp;&nbsp;&nbsp; exception exit: {function_clause,<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [{mysql_conn,start,<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [&quot;localhost&quot;,&quot;3306&quot;,&quot;ejabberd&quot;,&quot;test&quot;,<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &quot;jabberlog&quot;,<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [65536,131072],<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; #Fun&lt;mod_logdb_mysql5.1.37672236&gt;]},<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {mod_logdb_mysql5,init,1},<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {gen_server,init_it,6},<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {proc_lib,init_p,5}]}<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; in function&nbsp; gen_server:init_it/6<br />&nbsp;&nbsp;&nbsp; initial call: gen:init_it(gen_server,&lt;0.1243.0&gt;,self,<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp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nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {server,&quot;localhost&quot;},<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {port,&quot;3306&quot;},<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {db,&quot;jabberlog&quot;}]],<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [])<br />&nbsp;&nbsp;&nbsp; ancestors: [&#039;ejabberd_mod_logdb_web-sim.de&#039;,ejabberd_sup,&lt;0.850.0&gt;]<br />&nbsp;&nbsp;&nbsp; messages: []<br />&nbsp;&nbsp;&nbsp; links: []<br />&nbsp;&nbsp;&nbsp; dictionary: []<br />&nbsp;&nbsp;&nbsp; trap_exit: false<br />&nbsp;&nbsp;&nbsp; status: running<br />&nbsp;&nbsp;&nbsp; heap_size: 610<br />&nbsp;&nbsp;&nbsp; stack_size: 23<br />&nbsp;&nbsp;&nbsp; reductions: 163<br />&nbsp; neighbours:</code></div> <p>The only differnce is the "exception exit: {function_clause".</p> Thu, 05 Aug 2010 18:35:39 +0000 Seberoth comment 56482 at https://www.ejabberd.im Seberoth wrote: Hi, i have https://www.ejabberd.im/node/4183#comment-56470 <div class="quote-msg"> <div class="quote-author"><em>Seberoth</em> wrote:</div> <p>Hi,</p> <p>i have ejabberd 2.1.4 and try to run mog_logdb. But it can't connect to the MySQL Database (5.1.41).<br /> I also tried it with MySQL 5.0.xx</p> <p>erlang.log:</p> <div class="codeblock"><code>&nbsp;&nbsp;&nbsp; exception exit: {undef,<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [{mysql_conn,start,<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [&quot;localhost&quot;,&quot;3306&quot;,&quot;xxx&quot;,&quot;xxx&quot;,<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &quot;jabberlog&quot;,<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [65536,131072],<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; #Fun&lt;mod_logdb_mysql5.1.37672236&gt;]},<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {mod_logdb_mysql5,init,1},<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {gen_server,init_it,6},<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {proc_lib,init_p,5}]}</code></div> <p>I tried the patched MySQL Driver, the newest from SVN and <noindex><a href="http://code.google.com/p/erlang-mysql-driver/" title="http://code.google.com/p/erlang-mysql-driver/" rel="nofollow" >http://code.google.com/p/erlang-mysql-driver/</a></noindex></p> <p>Can anyone help me?</p></div> <p>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.</p> <p>Now you can check all the different mysql_conn.erl versions that you have downloaded, and find one that contains something like this:</p> <pre> -export([start/7, ... </pre><p> Once you find the proper mysql driver, compile it and install it (or copy it with all the other ejabberd *.beam files).</p> Mon, 02 Aug 2010 14:14:06 +0000 mfoss comment 56470 at https://www.ejabberd.im