MongoDB only works when run as root on Ubuntu – data directory issue

You created /data/db as root so it has those permissions. You can change the permissions to your user account, or whatever you have mongo running as.

chown -R username /data/db

or /data

You can also set a group

chown -R username.groupname

The -R does it recursively, so it will affect all the files you’ve created running mongoDB as root already.

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)