kezeng-CN / emqx_persistence_mysql

emqx通过MySQL持久化插件
Apache License 2.0
3 stars 2 forks source link

可以给一个详细一点的使用方法吗? #2

Open gifter123 opened 1 month ago

gifter123 commented 1 month ago

编译完成,可以运行,按照我建立了一个mqtt_database的数据库,并按照mysql.sql 建立了表,将 etc/emqx_persistence_mysql.conf 修改后,拷贝到emqx的执行路径的etc目录下,在emqx_dashboard中启动emqx_persistence_mysql插件后,在emqx_dashboard中显示,运行中,发送“$MYSQL”主题的hello world后,数据库并没有任何记录,on_client_connected也没任何记录。

gifter123 commented 1 month ago

2024-06-24T20:03:52.507554+08:00 [error] 4077f847-e90c-4b58-a1dd-b1ac185f42f51719229836902@172.27.176.1:51479 [Hooks] Failed to execute {emqx_persistence_mysql,on_session_subscribed,[[]]}: {error,undef,[{emqx_persistence_mysql,on_session_subscribed,[#{anonymous => true,auth_result => success,clientid => <<"4077f847-e90c-4b58-a1dd-b1ac185f42f51719229836902">>,is_bridge => false,is_superuser => false,mountpoint => undefined,peerhost => {172,27,176,1},protocol => mqtt,sockport => 1883,username => undefined,zone => external},<<"mysql">>,#{is_new => true,nl => 0,qos => 0,rap => 0,rh => 0,sub_props => #{}},[]],[]},{emqx_hooks,safe_execute,2,[{file,"emqx_hooks.erl"},{line,191}]},{emqx_hooks,do_run,2,[{file,"emqx_hooks.erl"},{line,157}]},{emqx_session,subscribe,4,[{file,"emqx_session.erl"},{line,249}]},{emqx_channel,do_subscribe,3,[{file,"emqx_channel.erl"},{line,659}]},{emqx_channel,process_subscribe,4,[{file,"emqx_channel.erl"},{line,644}]},{emqx_channel,handle_in,2,[{file,"emqx_channel.erl"},{line,636}]},{emqx_connection,with_channel,3,[{file,"emqx_connection.erl"},{line,659}]},{emqx_connection,process_msg,2,[{file,"emqx_connection.erl"},{line,364}]},{emqx_connection,process_msg,2,[{file,"emqx_connection.erl"},{line,370}]},{emqx_connection,handle_recv,3,[{file,"emqx_connection.erl"},{line,328}]},{proc_lib,wake_up,3,[{file,"proc_lib.erl"},{line,236}]}]}