二进制包下载地址:https://www.mongodb.org/dl/linux
tar xf mongodb-linux-x86_64-3.0.5.tgz -C/usr/local/
mv /usr/local/mongodb-linux-x86_64-3.0.5 /usr/local/mongodb
mkdir /usr/local/mongodb/data
touch /usr/local/mongodb/logs
groupadd mongodb
useradd -g mongodb mongodb -s/sbin/nologin -M
chown -R mongodb:mongodb /usr/local/mongodb
ll /usr/local/mongodb/bin
vim /etc/profile
mongod --dbpath=/usr/local/mongodb/data--fork --logpath=/usr/local/mongodb/logs
[[email protected] soft]# mongo
MongoDB shell version: 3.0.5
connecting to: test
默认数据库是test
时间: 2024-10-13 05:23:40