MongoDB: locale::facet::_S_create_c_locale name no

2019-01-31 08:13发布

I got this error message when trying to start mongod:

Tue Oct 29 21:33:23.589 [initandlisten] exception in initAndListen std::exception: locale::facet::_S_create_c_locale name not valid, terminating

I have tried remove it and re-installing, but I got the same error.

What can I do?

1条回答
smile是对你的礼貌
2楼-- · 2019-01-31 08:34

The error message: locale::facet::_S_create_c_locale name not valid indicates that mongod is unable to work with your operating system's current locale.

Adjusting your locale to C, which is supported by Mongo, will fix the problem:

export LC_ALL=C
mongod 

This isn't a perfect solution, however: LC_ALL=C forces sorted by byte order rather than locale-sensitive character ordering,

MongoDB locale support is generally lacking. There is an open JIRA ticket discussing locale support.

查看更多
登录 后发表回答