1. Add directory logs in root directory of portal;
2. Add logs in .gitignore;
3. Run command prompt as administrator;
4. Run commands: mongod -dbpath=D:\Projects\MongoDB\data -logpath=D:\Projects\MongoDB\logs\mongodb.log –install;
5. Press Win+R, input services.msc, find MongoDB, right click & start;
PS. Operate services in command prompt:
1. net start mongodb
2. net stop mongodb
3. sc delete mongodb
时间: 2024-12-22 23:40:53