我正在尝试通过终端从db_dump恢复MongoDB。
$ mongorestore -h localhost:27017 --db aaaa_production --archive=db_dump_071118.gz --gzip
Error parsing command line: unrecognised option '--archive=db_dump_071118.gz'
try 'mongorestore --help' for more information
答案 0 :(得分:4)
在运行mongorestore命令之前,请确保MongoDB在mongorestore命令中指定的同一端口上运行。在您的情况下,MongoDB应该在localhost:27017上运行,然后运行以下命令来还原数据库:
$ mongorestore -h localhost:27017 --db aaaa_production --gzip --archive=db_dump_071118.gz