mongodump failure 'locale::facet::_S_create_c_locale name not valid'

三世轮回 提交于 2020-01-03 19:34:09

问题


When I try to create a mongodb dump with

$ mongodump -d mydb

it fails

terminate called after throwing an instance of 'std::runtime_error'
  what():  locale::facet::_S_create_c_locale name not valid
Aborted

I have LC_ALL=en_US, Ubuntu 10.0.4, MongoDB 2.4.6 I suspect something is wrong with my locale, but can't find what exactly it is.


回答1:


I run into the same issue today. It's not strictly MongoDB related. It's locale/language related. Somehow the language on your computer is not defined correctly. I managed to fix my problem by typing:

sudo locale-gen en_US en_US.UTF-8
sudo locale-gen xx_XX xx_XX.UTF-8
sudo dpkg-reconfigure locales

These commands are to generate and configure the needed locales. After those steps everything should work as expected.



来源:https://stackoverflow.com/questions/19005990/mongodump-failure-localefacet-s-create-c-locale-name-not-valid

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!