1. Install the mongo

Recommend the use of rookie tutorial installation method, Windows,Linux,Mac system has a detailed method

2. Start the MongoDB service

Go to the MongoDB installation directory, go to the bin directory, and run the following command:

Export PATH=/usr/local/mongodb/bin:$PATH mongod --dbpath "--logpath"Copy the code

Note: An error may occur if the log location information is not set for the first time. Therefore, do not add logPath to a database directory for the first time

3. View the MongoDB database information

Switch to the bin folder where MongoDB is installed and run the./mongo command

Show DBS ==> Show all established database names use database_name ==> Go to the database show COLLECTIONS ==> See what tables the database database_name has Db.table_name. Find () ==> drop table db.table_name. Drop table () ===> drop table ()Copy the code