emqx / emqx-auth-mysql

Authentication, ACL with MySQL Database

Home Page:https://www.emqx.com

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Connnection refused: bad user name or password

yyguo1986 opened this issue · comments

I followed README.md to config and load this plugin. And inserted one user with name 'user' and password '123456' into mqtt_user table, but the connection was refused with errror 'bad user name or password' when testing. Can anyone help?

INSERT INTO mqtt_user (id, username, password, salt, is_superuser, created)
VALUES
(1,'user','123456','123456',True,'2016-10-26 10:00:00');

>mosquitto_sub -u user -P 123456 -d -i localmos -t #
Client localmos sending CONNECT
Client localmos received CONNACK
Connection Refused: bad user name or password.

@yyguo1986
I guess you should set the hash method for password to following line:

auth.mysql.password_hash = plain

Reload this plugin, try again!

Yeah, it works. Thanks so much.

Sorry, one more question:
After any update of conf file, currently it just works when restarting emqttd, not reloading this plugin. Why?

Yes, you are right! when you modified any etc/*.conf files, it just works when restarting emqttd!

It's my mistake. sorry

Thanks.