skip to Main Content

I’m trying to setup ejabberd with MySQL. Its always the localhost:3306: connection refused error coming every time. Any solutions?

Environment

ejabberd version: 19.09
OS: Linux (Debian)
Installed from: source

Configuration part for mysql

auth_method: sql
default_db: sql
sql_type: mysql
sql_server: "localhost"
sql_database: "ejabberd"
sql_username: "ejabberd"
sql_password: "ejabberd"
sql_port: 3306

Error log

2019-11-30 22:44:49.117 [error] <0.449.0>@ejabberd_sql:log:1043 p1_mysql_recv: Failed connecting to localhost:3306: connection refused
2019-11-30 22:44:49.117 [error] <0.450.0>@ejabberd_sql:log:1043 p1_mysql_recv: Failed connecting to localhost:3306: connection refused
2019-11-30 22:44:49.117 [error] <0.431.0>@ejabberd_sql:log:1043 p1_mysql_conn: Failed connecting to "localhost":3306 : {error,"connect failed: connection refused"}
2019-11-30 22:44:49.117 [error] <0.432.0>@ejabberd_sql:log:1043 p1_mysql_conn: Failed connecting to "localhost":3306 : {error,"connect failed: connection refused"}
2019-11-30 22:44:49.117 [error] <0.433.0>@ejabberd_sql:log:1043 p1_mysql_conn: Failed connecting to "localhost":3306 : {error,"connect failed: connection refused"}
2019-11-30 22:44:49.117 [error] <0.434.0>@ejabberd_sql:log:1043 p1_mysql_conn: Failed connecting to "localhost":3306 : {error,"connect failed: connection refused"}
2019-11-30 22:44:49.117 [error] <0.435.0>@ejabberd_sql:log:1043 p1_mysql_conn: Failed connecting to "localhost":3306 : {error,"connect failed: connection refused"}
2019-11-30 22:44:49.117 [error] <0.436.0>@ejabberd_sql:log:1043 p1_mysql_conn: Failed connecting to "localhost":3306 : {error,"connect failed: connection refused"}
2019-11-30 22:44:49.117 [error] <0.437.0>@ejabberd_sql:log:1043 p1_mysql_conn: Failed connecting to "localhost":3306 : {error,"connect failed: connection refused"}
2019-11-30 22:44:49.117 [error] <0.438.0>@ejabberd_sql:log:1043 p1_mysql_conn: Failed connecting to "localhost":3306 : {error,"connect failed: connection refused"}
2019-11-30 22:44:49.117 [error] <0.439.0>@ejabberd_sql:log:1043 p1_mysql_conn: Failed connecting to "localhost":3306 : {error,"connect failed: connection refused"}
2019-11-30 22:44:49.117 [error] <0.440.0>@ejabberd_sql:log:1043 p1_mysql_conn: Failed connecting to "localhost":3306 : {error,"connect failed: connection refused"}
2019-11-30 22:44:49.117 [error] <0.421.0>@ejabberd_sql:log:1043 p1_mysql_conn: post_start error connect_failed
2019-11-30 22:44:49.117 [error] <0.427.0>@ejabberd_sql:log:1043 p1_mysql_conn: post_start error connect_failed

Errors from error.log/crash.log

2019-11-30 22:36:58 =CRASH REPORT====
crasher:
initial call: mod_mqtt:init/1
pid: <0.525.0>
registered_name: []
exception exit: {db_failure,[{gen_server,init_it,6,[{file,"gen_server.erl"},{line,349}]},{proc_lib,init_p_do_apply,3,[{file,"proc_lib.erl"},{line,247}]}]}
ancestors: [ejabberd_gen_mod_sup,ejabberd_sup,<0.88.0>]
message_queue_len: 0
messages: []
links: [<0.403.0>]
dictionary: []
trap_exit: false
status: running
heap_size: 987
stack_size: 27
reductions: 1073
neighbours:

2

Answers


  1. Chosen as BEST ANSWER

    The issue is from the mysql. I found it in the mysql log file. I increased the max_allowed_packet to a bigger size and increased RAM after that all good.


    1. Maybe connection random lost
    2. May be unreachable
    3. Try the following mysql -u ejabberd -h localhost -p password
    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search