Skip to content
This repository has been archived by the owner on Mar 12, 2019. It is now read-only.

Access denied for user 'root'@'localhost' (using password: NO) #42

Closed
mariopraga opened this issue Nov 22, 2014 · 4 comments
Closed

Access denied for user 'root'@'localhost' (using password: NO) #42

mariopraga opened this issue Nov 22, 2014 · 4 comments

Comments

@mariopraga
Copy link

This is what i got on my log when I try to start mosquitto .
In my /etc/mosquitto/mosquitto.conf I don't have root user but mqtt user and it's password.

1416657377: mosquitto version 1.3.4 (build date 2014-08-08 09:26:34+0000) starting
1416657377: Config loaded from /etc/mosquitto/mosquitto.conf.
1416657377: |-- *** auth-plug: startup
1416657377: |-- ** Configured order: mysql

1416657377: |-- }}}} MYSQL
Access denied for user 'root'@'localhost' (using password: NO)
1416657377: Opening ipv4 listen socket on port 1883.
1416657377: Opening ipv6 listen socket on port 1883.
1416657378: New connection from xx.xx.xx.xxx on port 1883.

@jpmens
Copy link
Owner

jpmens commented Nov 22, 2014

Without seeing your config it's hard to see what is happening. I'm assuming you configured credentials for MySQL backend incorrectly.

@mariopraga
Copy link
Author

This is my mosquitto.conf and start command :
/usr/sbin/mosquitto -d -c /etc/mosquitto/mosquitto.conf > /var/log/mosquitto.log 2>&1 &

pid_file /var/run/mosquitto.pid

persistence true
persistence_location /var/lib/mosquitto/

include_dir /etc/mosquitto/conf.d

auth_plugin /usr/lib64/auth-plug.so
auth_opt_backends mysql

auth_opt_host localhost
auth_opt_port 3306
auth_opt_username mqtt
auth_opt_password mqtt
auth_opt_dbname mqttwarn_db
auth_opt_userquery SELECT pw FROM mosquitto-auth-users WHERE username = '%s'

@mariopraga
Copy link
Author

Sorry, I have just found the problem

wrong:
auth_opt_username
auth_opt_password

correct:
auth_opt_user
auth_opt_pass

Still cannot connect with user and password ( have to do some checks ) , instead I noticed a big issue. When i run mosquitto_pub from my linux terminal without using user and password parameters the mosquitto daemon crash.

@jpmens
Copy link
Owner

jpmens commented Nov 23, 2014

You are going to have to give me more information. Linux disto, Mosquitto version, full configs (without your passwords) and exact testing procedures.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants