In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-04-06 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >
Share
Shulou(Shulou.com)06/01 Report--
Mongo operation refer to this article http://wiki.jikexueyuan.com/project/mongodb/ the version here can modify wget http://downloads.mongodb.org/linux/mongodb-linux-x86_64-2.4.6.tgztar-zxvf mongodb-linux-x86_64-2.4.6.tgzcp-r mongodb-linux-x86_64-2.4.6 / opt/mongodbcd / opt/mongodbmkdir-p data/log confmongo configuration file does not exist by default and needs to be specified manually Create your own vim conf/mongodb.confport = 29016 # port number dbpath = / opt/mongodb/data/db # database path logpath = / opt/mongodb/data/log/log # log output file specified file instead of directory logappend = true # log output mode (append) auth = true # enable authentication fork = true # run pidfilepath = / opt/mongodb/data/mongod.pid # PID file location setting ring as a daemon The context variable adds export PATH=/opt/mongodb/bin:$PATHsource / etc/profilemongod-f / opt/mongodb/conf/mongodb.conf # at the end of / etc/profile to start mongomongo 127.0.0.1 etc/profilemongod 29016 use admin # to enter the database admindb.addUser ('name' 'pwd') # add users or change user passwords Users who build under admin have all permissions. Users who build under the corresponding database only have the database permission db.auth ('name','pwd') # user authentication show users # View all users show dbs # View all databases db.shutdownServer () # stop database use mydb # create new database, and if you leave without doing anything, the library will delete db.test.insert ({' test':'1'}) # create test table Insert a data show dbs and you can see the new database.
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.