我正在尝试用ejabberd
设置MySQL
。每次都会出现localhost:3306: connection refused error
。有什么办法吗?
ejabberd version: 19.09
OS: Linux (Debian)
Installed from: source
auth_method: sql
default_db: sql
sql_type: mysql
sql_server: "localhost"
sql_database: "ejabberd"
sql_username: "ejabberd"
sql_password: "ejabberd"
sql_port: 3306
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
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:
mysql -u ejabberd -h localhost -p password
问题出在mysql
。我在mysql log
文件中找到了它。我把max_allowed_packet
增大到一个更大的尺寸,然后又把RAM
增大了。