mongodb - mongodump无法导出数据
phpcn_u1582
phpcn_u1582 2017-05-02 09:22:24
0
2
686

用mongodump导出位于服务器上的数据,然后用mongorestore到本地上作调试用,但是用mongodump怎么也无法导出数据,命令如下:mongodump -h localhost:27017 -d xxx -c xx,运行命令后可以看到在当前路径下生成了一个dump文件夹,里面有一个xxx文件夹,但是xxx文件夹里面并没有我想要导出的xx collections,端口是正确的,实在是找不到问题所在

phpcn_u1582
phpcn_u1582

reply all(2)
为情所困

I can only say that there are no grammatical errors. If it cannot be exported, it can only be because the database name or collection is wrong.
Because of the particularity of mongodb, it will not report an error that a certain collection does not exist, but will only export an empty collection.
Confirm whether the collection or database name is wrong, please connect to the shell first

show dbs
show collections
世界只因有你

In fact, it may be that the data you want to export is too large. I remember that there are restrictions on mongodump export data. You can use mongoexport to try it

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template