MongoDB Permissions mechanism and extension

Source: Internet
Author: User
Tags auth php server

mongodb permissions mechanism

before you start the permission mechanism, first Add admin account in MONGODB:

1. Create an Account

    1. 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

    1. Modify The php.ini file to add a line:

4. restart Apache

MongoDB Permissions mechanism and extension

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.