emqx-docs
emqx-docs copied to clipboard
Invalid ACL SQL in document
File: /en_US/advanced/acl-mysql.md
-- All users cannot subscribe to system topics
INSERT INTO mqtt_acl (allow, ipaddr, username, clientid, access, topic) VALUES (0, NULL, '$all', NULL, 1, '$SYS/#');
For the rule to work, the acl_query in the given doc should be
auth.pgsql.acl_query = select allow, ipaddr,'%u', clientid, access, topic from mqtt_acl where ipaddr = '%a' or username = '%u' or username = '$all' or clientid = '%c'
Instead of (notice the change in the select field username)
auth.pgsql.acl_query = select allow, ipaddr, username, clientid, access, topic from mqtt_acl where ipaddr = '%a' or username = '%u' or username = '$all' or clientid = '%c'