mosquitto auth plugin database issue
<p>I am using <a href="https://github.com/jpmens/mosquitto-auth-plug#postgresql" rel="nofollow">mosquitto auth plugin</a> here is my mosquitto.config file</p>

<pre><code>listener 1883

#listener 9001 127.0.0.1
#protocol websockets

auth_opt_backends postgres
auth_plugin /etc/mosquitto/auth-plug.so
auth_opt_dbname mqtt
auth_opt_host localhost
auth_opt_port 5432
auth_opt_user postgres
auth_opt_pass postgres
auth_opt_userquery SELECT password FROM account WHERE username = $1 limit 1
auth_opt_superquery SELECT COALESCE(COUNT(*),0) FROM account WHERE username = $1 AND super = 1
auth_opt_aclquery SELECT topic FROM acls WHERE (username = $1) AND (rw &gt;= $2)
</code></pre>

<p>all <code>postgres</code> setting are default <code>postgres</code> settings.
when I run </p>

<pre><code>sudo /usr/local/sbin/mosquitto -c /etc/mosquitto/mosquitto.conf
</code></pre>

<p>command. I am getting this error:</p>

<pre><code>1456228482: mosquitto version 1.4.8 (build date 2016-02-22 18:23:09+0530) starting
1456228482: Config loaded from /etc/mosquitto/mosquitto.conf.
1456228482: |-- *** auth-plug: startup
1456228482: |-- ** Configured order: postgres

1456228482: |-- }}}} POSTGRES
1456228482: |-- HERE: SELECT COALESCE(COUNT(*),0) FROM account WHERE username = $1 AND super = 1
1456228482: |-- HERE: SELECT topic FROM acls WHERE (username = $1) AND (rw &gt;= $2)
|-- We were unable to connect to the database
|-- *** ABORT.
</code></pre>

<p>If I uncomment these two line</p>

<pre><code>#listener 9001 127.0.0.1
#protocol websockets
</code></pre>

<p>i get this error:</p>

<pre><code>Error: Websockets support not available.
Error found at /etc/mosquitto/mosquitto.conf:4.
Error: Unable to open configuration file.
</code></pre>

<p>I was following these tutorial</p>

<p><a href="http://www.kirang.in/2015/05/23/setting-up-acl-in-mosquitto-using-postgres/" rel="nofollow">Tutorial1</a>
<a href="http://my-classes.com/2015/02/05/acl-mosquitto-mqtt-broker-auth-plugin/" rel="nofollow">Tutorial2</a></p>

<p>after changing password of postgres and chaging the default port 1883</p>

<pre><code>1456232627: mosquitto version 1.4.8 (build date 2016-02-22 18:23:09+0530) starting
1456232627: Config loaded from /etc/mosquitto/mosquitto.conf.
1456232627: |-- *** auth-plug: startup
1456232627: |-- ** Configured order: postgres

1456232627: |-- }}}} POSTGRES
1456232627: |-- HERE: SELECT COALESCE(COUNT(*),0) FROM account WHERE username = $1 AND super = 1
1456232627: |-- HERE: SELECT topic FROM acls WHERE (username = $1) AND (rw &gt;= $2)
1456232627: Opening ipv4 listen socket on port 1884.
1456232627: Opening ipv6 listen socket on port 1884.
1456232627: Error: Invalid user 'mosquitto'.
</code></pre>

<p>from where "mosquitto" user is comming ?</p>