I just found a 2.4.5 version, and the --fork parameter cannot be used.
The command --fork only works for Linux/Unix. If you need --fork for running mongod in background, on Windows that can be achieved by installing mongod as a service. When use mongod --install option to install mongodb service, the --dbpath and --logpath are required. In my case, I need use administrator command console to install the service.
It seems that windows does not support the --fork parameter. The solution is to use --install to install the windows service.
mongodb.conf file
Start the server under cmd
mongodb.log file
Because direct cmd startup does not have enough permissions, administrator rights are required to open cmd.exe.
cmd administrator rights to start the server
mongodb.log file
Then directly enter net start MongoDB to start the server, and then you can close the window (it is running in the background).
I just found a 2.4.5 version, and the --fork parameter cannot be used.
It seems that windows does not support the --fork parameter. The solution is to use --install to install the windows service.
mongodb.conf file
Start the server under cmd
mongodb.log file
Because direct cmd startup does not have enough permissions, administrator rights are required to open cmd.exe.
cmd administrator rights to start the server
mongodb.log file
Then directly enter net start MongoDB to start the server, and then you can close the window (it is running in the background).