Everyone has heard about Mongo DB. MongoDB is an open-source tool that supports NoSQL. It is document-oriented not object-oriented. MongoDB is usually used when large data is set to manage information. Here we discuss the installation of MongoDB on Wamp. Before we know about what is Mongo DB and its features. Let’s discuss this shortly.
Mongo DB
Mongo DB is an open-source NoSQL information-based administration program. NoSQL is utilized as an alternative option to a traditional relational database. Mongo is quite useful for working with large sets of distributed data. Mongo DB is used to manage document-oriented information, and store or receive data.
Features of Mongo DB
Below we listing the features of Mongo DB,
- Ad-hoc queries for optimization of real-time analysis.
- Indexing for better query optimization.
- Replication for data stability.
- Sharding.
- Load balancing.
Requirements
Kindly install,
- PHP extension
- wamp server
- Apache
Steps to Install Mongo DB on WAMP
Below is the list of instructions that follow to install the MongoDB driver on the wamp server.
- Download .delete file
Download the .dll file from this link//pecl.php.net/package/mongo/1.6.11/windows, remember that version that you download is compatible with your PHP version. Unzip the folder.
- Put .dll file into PHP extension
Copy .dll file and paste into php extension directory.
- Open the php.ini file
Open the php.ini file for adding the mongo DB extension.
- Enable php_mongo.dll extension
Search below line into php.ini file,
extension=php_mongo.dll
If found then okay, otherwise add this line into php.ini. Don’t forget to remove semicolons.
Restart the wamp server
Restart the wamp server, if found any error then mongo DB is not installed.
- Check whether drivers installed or not
After installation is done then open phpinfo[] file to check mongo DB drivers.
Conclusion
By following the above steps you can able to install MongoDB drivers on the wamp server. I hope you clear all the steps and follow them as per the given order.
Cài đặt Mongodb và wamp chạy ứng dụng php đầu tiên
Mongodb là một CSDL dạng NoSQL có không ràng buộc nói đơn giản là cơ sở dữ liệu mà không dùng mô hình dữ liệu quan hệ .
B1 - kiểm tra cài đặt đúng phiên bản mongo và php , wamp server
A - mongodb chọn phiên bản
//www.mongodb.org/downloads phù hợp hệ điều hành
download về copy file về thư mục C:\bin
B- cài đặt mongo_db.dll -phiên bản phù hợp với php hiện tại
--để biết phiên bản php phù hợp với phần nào ta vào phpinfo[] để kiểm tra :
ở đây là bản cũ VC6
PHP Extension Build-API20090626,TS,VC6
tại đây //downloads.php.net/pierre/
hay tại đây
//github.com/mongodb/mongo-php-driver/downloads
sau khi chọn download file php_mongo.dll phù hợp copy vào thư mục của wamp
C:\wamp\bin\php\php5.3.5\ext
để wamp nhận biết cần mở php.ini tìm hay thêm dòng này vào
extension=php_mongo.dll
reset lại wamp
B2: Chạy thử và Tạo Database
cấu hình ngắn gọn để gọi mongo
vào mycomputer->properties ->environment variables -> tìm path và edit thêm C:\bin vào
1-khởi động mongod bằng cách mở cmd gõ vào
mongod --dbpath C:/bin
ok xong
2-để nguyên cửa sổ đang chạy mongod- mở tiếp cửa sổ thứ 2 cmd gõ tiếp
use data
trong đó data là tên database cần tạo
db.addUser["admin","pass"]
tạo username và pass
db.game.save[{user:"so1",pass:"pass"}]
để tạo bảng game
để truy vấn bảng
db.game.find[]
3 Tạo 1 file php để thử insert dữ liệu vào xem sao
nội dung file php như sau
xem thử kết quả
db.game.find[]
quản lý mongodb với rockmongo user nam và pass là admin