mongodb permissions mechanism
before you start the permission mechanism, first Add admin account in MONGODB:
1. Create an Account
- To reinstall a mongodb, add a --auth parameter when installing:
First remove the installed from the service (after the data is deleted and no data is deleted)
Reinstall Mognodb, add the --auth parameter when installing:
The permission mechanism is now turned on.
You cannot manipulate the database now without logging on:
You must be logged in before you can:
How to use
PHP Operation MongoDB
The code of the PHP operation MongoDB is basically the same as the command line.
there is a prerequisite to executing this code: The MONGO extension is installed on the PHP server .
Phpinf ();
how PHP installs MONGO Extensions:
1. first download a php_mongo.dll file that conforms to the PHP server environment
2. Copy the dll to
- Modify The php.ini file to add a line:
4. restart Apache
MongoDB Permissions mechanism and extension