环境信息
- EMQX 版本:5.0.0
问题描述
通过docker启动EMQX, 并使用env传递参数进行配置连接mysql认证,但是并未生效
配置文件及日志
version: "3"
services:
emqx:
image: emqx/emqx:5.0.0
container_name: emqx5_0
environment:
- EMQX_DASHBOARD__DEFAULT_USERNAME=admin
- EMQX_DASHBOARD__DEFAULT_PASSWORD=Cyfl309311.
- EMQX_AUTHENTICATION__2__MECHANISM=password_based
- EMQX_AUTHENTICATION__2__BACKEND=mysql
- EMQX_AUTHENTICATION__2__ENABLE=true
- EMQX_AUTHENTICATION__2__PASSWORD_HASH_ALGORITHM="{name = plain, salt_position = disable}"
- EMQX_AUTHENTICATION__2__DATABASE=emqx
- EMQX_AUTHENTICATION__2__USERNAME=root
- EMQX_AUTHENTICATION__2__PASSWORD=123456
- EMQX_AUTHENTICATION__2__SERVER="192.168.0.43:3306"
- EMQX_AUTHENTICATION__2__QUERY="SELECT password_hash FROM mqtt_user where username = ${username} LIMIT 1"
ports:
- "18083:18083"
- "1883:1883"