From 2379dfaf299c8b196f5fc88501dc5b3cb2211a62 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=BB=84=E6=B5=B7?= <10402852@qq.com> Date: Tue, 30 Jul 2024 16:37:14 +0800 Subject: [PATCH] 'commit' --- 操作文档/3、安装Mongodb.txt | 8 ++++++++ .../6、MongoDB数据库下载与还原.txt | 14 +------------- 2 files changed, 9 insertions(+), 13 deletions(-) diff --git a/操作文档/3、安装Mongodb.txt b/操作文档/3、安装Mongodb.txt index d0eb772..dfce545 100644 --- a/操作文档/3、安装Mongodb.txt +++ b/操作文档/3、安装Mongodb.txt @@ -24,9 +24,17 @@ cd /usr/local/mongodb chmod 777 db chmod 777 log + # 启动MongoDB /usr/local/mongodb/bin/mongod --dbpath /usr/local/mongodb/db --bind_ip 0.0.0.0 --port 27017 --fork --journal --logpath /usr/local/mongodb/log/mongod.log --logappend --noauth --directoryperdb +use admin + +#创建管理员账号 +db.createUser({ user: "admin", pwd: "yourpassword", roles: [ { role: "userAdminAnyDatabase", db: "admin" } ] }) + + + yum install net-tools -y netstat -lanp | grep "27017" diff --git a/操作文档/6、MongoDB数据库下载与还原.txt b/操作文档/6、MongoDB数据库下载与还原.txt index 3f1e535..de2f193 100644 --- a/操作文档/6、MongoDB数据库下载与还原.txt +++ b/操作文档/6、MongoDB数据库下载与还原.txt @@ -49,19 +49,7 @@ chmod 777 log # 启动命令 /usr/local/mongodb/bin/mongod --dbpath /usr/local/mongodb/db --bind_ip 0.0.0.0 --port 27017 --fork --journal --logpath /usr/local/mongodb/log/mongod.log --logappend --noauth --directoryperdb - -# 本地的数据库备份操作 - mongodump - -[root@RockyLinux /]# cd /usr/local/mongodb/db/dump -[root@RockyLinux dump]# ll -total 4 -drwxr-xr-x. 2 root root 128 Jul 29 23:02 admin -drwxr-xr-x. 2 root root 4096 Jul 29 23:04 yltcharge -[root@RockyLinux dump]# du -sh -48G . - - +----------------------------------------------------------------------- # 常用维护命令 https://blog.csdn.net/Waldocsdn/article/details/130155631