I have tried with user with mysql_native_password and caching_sha2_password
Both dint work
In logs I am getting following error
2019-05-15 12:03:03.188 [info] supervisor: {<0.2268.0>,ecpool_pool_sup}
started: [{pid,<0.2269.0>},
{id,pool},
{mfargs,{ecpool_pool,start_link,
[emqx_auth_mysql,
[{pool_size,8},
{auto_reconnect,1},
{host,"localhost"},
{port,3306},
{user,"mqtttestuser"},
{password,"MqttTestUserPass123"},
{database,"mqtt"},
{encoding,utf8},
{keep_alive,true}]]}},
{restart_type,transient},
{shutdown,65535},
{child_type,worker}]
2019-05-15 12:03:03.192 [error] crasher:
initial call: mysql:init/1
pid: <0.2272.0>
registered_name: []
exception error: {auth_method,<<"caching_sha2_password">>}
in function mysql_protocol:build_handshake_response/5 (src/mysql_protocol.erl, line 310)
in call from mysql_protocol:handshake/7 (src/mysql_protocol.erl, line 64)
in call from mysql:init/1 (src/mysql.erl, line 499)
in call from gen_server:init_it/2 (gen_server.erl, line 374)
in call from gen_server:init_it/6 (gen_server.erl, line 342)
ancestors: [<0.2271.0>,<0.2270.0>,<0.2268.0>,emqx_auth_mysql_sup,
<0.2266.0>]
message_queue_len: 0
messages: []
links: [<0.2271.0>,#Port<0.49>]
dictionary: []
trap_exit: false
status: running
heap_size: 987
stack_size: 27
reductions: 1093
neighbours:
2019-05-15 12:03:03.193 [error] supervisor: {<0.2270.0>,ecpool_worker_sup}
errorContext: start_error
reason: {{auth_method,<<"caching_sha2_password">>},
[{mysql_protocol,build_handshake_response,5,
[{file,"src/mysql_protocol.erl"},{line,310}]},
{mysql_protocol,handshake,7,
[{file,"src/mysql_protocol.erl"},{line,64}]},
{mysql,init,1,[{file,"src/mysql.erl"},{line,499}]},
{gen_server,init_it,2,[{file,"gen_server.erl"},{line,374}]},
{gen_server,init_it,6,[{file,"gen_server.erl"},{line,342}]},
{proc_lib,init_p_do_apply,3,
[{file,"proc_lib.erl"},{line,249}]}]}
offender: [{pid,undefined},
{id,{worker,1}},
{mfargs,{ecpool_worker,start_link,
[emqx_auth_mysql,1,emqx_auth_mysql_cli,
[{pool_size,8},
{auto_reconnect,1},
{host,"localhost"},
{port,3306},
{user,"mqtttestuser"},
{password,"MqttTestUserPass123"},
{database,"mqtt"},
{encoding,utf8},
{keep_alive,true}]]}},
{restart_type,transient},
{shutdown,5000},
{child_type,worker}]
2019-05-15 12:03:03.194 [error] crasher:
initial call: ecpool_worker:init/1
pid: <0.2271.0>
registered_name: []
exception exit: {{auth_method,<<"caching_sha2_password">>},
[{mysql_protocol,build_handshake_response,5,
[{file,"src/mysql_protocol.erl"},
{line,310}]},
{mysql_protocol,handshake,7,
[{file,"src/mysql_protocol.erl"},
{line,64}]},
{mysql,init,1,[{file,"src/mysql.erl"},{line,499}]},
{gen_server,init_it,2,
[{file,"gen_server.erl"},{line,374}]},
{gen_server,init_it,6,
[{file,"gen_server.erl"},{line,342}]},
{proc_lib,init_p_do_apply,3,
[{file,"proc_lib.erl"},{line,249}]}]}
in function gen_server:init_it/6 (gen_server.erl, line 358)
ancestors: [<0.2270.0>,<0.2268.0>,emqx_auth_mysql_sup,<0.2266.0>]
message_queue_len: 0
messages: []
links: [<0.2270.0>,<0.2272.0>]
dictionary: []
trap_exit: true
status: running
heap_size: 610
stack_size: 27
reductions: 350
neighbours:
neighbour:
pid: <0.2272.0>
registered_name: []
initial call: mysql:init/1
current_function: {io_lib_format,build,2}
ancestors: [<0.2271.0>,<0.2270.0>,<0.2268.0>,emqx_auth_mysql_sup,
<0.2266.0>]
message_queue_len: 0
links: [<0.2271.0>,#Port<0.49>]
trap_exit: false
status: runnable
heap_size: 4185
stack_size: 97
reductions: 25112
current_stacktrace: [{unicode_util,cp,1,[{file,"unicode_util.erl"},{line,289}]},
{unicode_util,cp,1,[{file,"unicode_util.erl"},{line,292}]},
{unicode_util,gc_extend,2,
[{file,"unicode_util.erl"},{line,508}]},
{string,length_1,2,[{file,"string.erl"},{line,545}]},
{io_lib_format,build_limited,5,
[{file,"io_lib_format.erl"},{line,283}]},
{io_lib_format,build_limited,5,
[{file,"io_lib_format.erl"},{line,293}]},
{io_lib_format,build_limited,5,
[{file,"io_lib_format.erl"},{line,297}]},
{io_lib_format,build_limited,5,
[{file,"io_lib_format.erl"},{line,290}]}]
2019-05-15 12:03:03.199 [error] supervisor: {<0.2268.0>,ecpool_pool_sup}
errorContext: start_error
reason: {shutdown,
{failed_to_start_child,
{worker,1},
{{auth_method,<<"caching_sha2_password">>},
[{mysql_protocol,build_handshake_response,5,
[{file,"src/mysql_protocol.erl"},{line,310}]},
{mysql_protocol,handshake,7,
[{file,"src/mysql_protocol.erl"},{line,64}]},
{mysql,init,1,[{file,"src/mysql.erl"},{line,499}]},
{gen_server,init_it,2,
[{file,"gen_server.erl"},{line,374}]},
{gen_server,init_it,6,
[{file,"gen_server.erl"},{line,342}]},
{proc_lib,init_p_do_apply,3,
[{file,"proc_lib.erl"},{line,249}]}]}}}
offender: [{pid,undefined},
{id,worker_sup},
{mfargs,
{ecpool_worker_sup,start_link,
[emqx_auth_mysql,emqx_auth_mysql_cli,
[{pool_size,8},
{auto_reconnect,1},
{host,"localhost"},
{port,3306},
{user,"mqtttestuser"},
{password,"MqttTestUserPass123"},
{database,"mqtt"},
{encoding,utf8},
{keep_alive,true}]]}},
{restart_type,transient},
{shutdown,infinity},
{child_type,supervisor}]
2019-05-15 12:03:03.203 [error] supervisor: {local,emqx_auth_mysql_sup}
errorContext: start_error
reason: {shutdown,
{failed_to_start_child,worker_sup,
{shutdown,
{failed_to_start_child,
{worker,1},
{{auth_method,<<"caching_sha2_password">>},
[{mysql_protocol,build_handshake_response,5,
[{file,"src/mysql_protocol.erl"},
{line,310}]},
{mysql_protocol,handshake,7,
[{file,"src/mysql_protocol.erl"},{line,64}]},
{mysql,init,1,
[{file,"src/mysql.erl"},{line,499}]},
{gen_server,init_it,2,
[{file,"gen_server.erl"},{line,374}]},
{gen_server,init_it,6,
[{file,"gen_server.erl"},{line,342}]},
{proc_lib,init_p_do_apply,3,
[{file,"proc_lib.erl"},{line,249}]}]}}}}}
offender: [{pid,undefined},
{id,emqx_auth_mysql},
{mfargs,{ecpool,start_pool,
[emqx_auth_mysql,emqx_auth_mysql_cli,
[{pool_size,8},
{auto_reconnect,1},
{host,"localhost"},
{port,3306},
{user,"mqtttestuser"},
{password,"MqttTestUserPass123"},
{database,"mqtt"},
{encoding,utf8},
{keep_alive,true}]]}},
{restart_type,permanent},
{shutdown,5000},
{child_type,supervisor}]
2019-05-15 12:03:03.207 [error] crasher:
initial call: application_master:init/4
pid: <0.2265.0>
registered_name: []
exception exit: {bad_return,
{{emqx_auth_mysql_app,start,[normal,[]]},
{'EXIT',
{{badmatch,
{error,
{shutdown,
{failed_to_start_child,emqx_auth_mysql,
{shutdown,
{failed_to_start_child,worker_sup,
{shutdown,
{failed_to_start_child,
{worker,1},
{{auth_method,<<"caching_sha2_password">>},
[{mysql_protocol,build_handshake_response,5,
[{file,"src/mysql_protocol.erl"},
{line,310}]},
{mysql_protocol,handshake,7,
[{file,"src/mysql_protocol.erl"},
{line,64}]},
{mysql,init,1,
[{file,"src/mysql.erl"},{line,499}]},
{gen_server,init_it,2,
[{file,"gen_server.erl"},{line,374}]},
{gen_server,init_it,6,
[{file,"gen_server.erl"},{line,342}]},
{proc_lib,init_p_do_apply,3,
[{file,"proc_lib.erl"},
{line,249}]}]}}}}}}}}},
[{emqx_auth_mysql_app,start,2,
[{file,"src/emqx_auth_mysql_app.erl"},{line,31}]},
{application_master,start_it_old,4,
[{file,"application_master.erl"},{line,277}]}]}}}}
in function application_master:init/4 (application_master.erl, line 138)
ancestors: [<0.2264.0>]
message_queue_len: 1
messages: [{'EXIT',<0.2266.0>,normal}]
links: [<0.2264.0>,<0.1203.0>]
dictionary: []
trap_exit: true
status: running
heap_size: 987
stack_size: 27
reductions: 246
neighbours:
2019-05-15 12:03:03.212 [notice] application: emqx_auth_mysql
exited: {bad_return,
{{emqx_auth_mysql_app,start,[normal,[]]},
{'EXIT',
{{badmatch,
{error,
{shutdown,
{failed_to_start_child,emqx_auth_mysql,
{shutdown,
{failed_to_start_child,worker_sup,
{shutdown,
{failed_to_start_child,
{worker,1},
{{auth_method,<<"caching_sha2_password">>},
[{mysql_protocol,build_handshake_response,5,
[{file,"src/mysql_protocol.erl"},{line,310}]},
{mysql_protocol,handshake,7,
[{file,"src/mysql_protocol.erl"},{line,64}]},
{mysql,init,1,[{file,"src/mysql.erl"},{line,499}]},
{gen_server,init_it,2,
[{file,"gen_server.erl"},{line,374}]},
{gen_server,init_it,6,
[{file,"gen_server.erl"},{line,342}]},
{proc_lib,init_p_do_apply,3,
[{file,"proc_lib.erl"},{line,249}]}]}}}}}}}}},
[{emqx_auth_mysql_app,start,2,
[{file,"src/emqx_auth_mysql_app.erl"},{line,31}]},
{application_master,start_it_old,4,
[{file,"application_master.erl"},{line,277}]}]}}}}
type: temporary
2019-05-15 12:03:03.213 [error] Load plugin emqx_auth_mysql error, cannot start app emqx_auth_mysql for {bad_return,
{{emqx_auth_mysql_app,
start,
[normal,
[]]},
{'EXIT',
{{badmatch,
{error,
{shutdown,
{failed_to_start_child,
emqx_auth_mysql,
{shutdown,
{failed_to_start_child,
worker_sup,
{shutdown,
{failed_to_start_child,
{worker,
1},
{{auth_method,
<<"caching_sha2_password">>},
[{mysql_protocol,
build_handshake_response,
5,
[{file,
"src/mysql_protocol.erl"},
{line,
310}]},
{mysql_protocol,
handshake,
7,
[{file,
"src/mysql_protocol.erl"},
{line,
64}]},
{mysql,
init,
1,
[{file,
"src/mysql.erl"},
{line,
499}]},
{gen_server,
init_it,
2,
[{file,
"gen_server.erl"},
{line,
374}]},
{gen_server,
init_it,
6,
[{file,
"gen_server.erl"},
{line,
342}]},
{proc_lib,
init_p_do_apply,
3,
[{file,
"proc_lib.erl"},
{line,
249}]}]}}}}}}}}},
[{emqx_auth_mysql_app,
start,
2,
[{file,
"src/emqx_auth_mysql_app.erl"},
{line,
31}]},
{application_master,
start_it_old,
4,
[{file,
"application_master.erl"},
{line,
277}]}]}}}}
2019-05-15 12:03:03.273 [error] PUT /api/v3/nodes/[email protected]/plugins/emqx_auth_mysql/load error: badarg, stacktrace:
[{jsx_parser,value,4,[{file,"src/jsx_parser.erl"},{line,163}]},
{minirest_handler,jsonify,4,[{file,"src/minirest_handler.erl"},{line,130}]},
{minirest,handle_request,2,[{file,"src/minirest.erl"},{line,66}]},
{minirest,init,2,[{file,"src/minirest.erl"},{line,51}]},
{cowboy_handler,execute,2,[{file,"src/cowboy_handler.erl"},{line,37}]},
{cowboy_stream_h,execute,3,[{file,"src/cowboy_stream_h.erl"},{line,274}]},
{cowboy_stream_h,request_process,3,
[{file,"src/cowboy_stream_h.erl"},{line,252}]},
{proc_lib,init_p_do_apply,3,[{file,"proc_lib.erl"},{line,249}]}]