mongodump failure 'locale::facet::_S_create_c_

2019-06-25 13:56发布

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条回答
兄弟一词,经得起流年.
2楼-- · 2019-06-25 14:40

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.

查看更多
登录 后发表回答