MongoDB:locale::facet::_S_create_c_locale 名称无效

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/19668570/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-09 13:28:22  来源:igfitidea点击:

MongoDB: locale::facet::_S_create_c_locale name not valid

mongodbubuntulocale

提问by Osama Jetawe

I got this error message when trying to start mongod:

尝试启动时收到此错误消息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?

我能做什么?

回答by joews

The error message: locale::facet::_S_create_c_locale name not validindicates that mongodis unable to work with your operating system's current locale.

错误消息: locale::facet::_S_create_c_locale name not valid表示mongod无法使用您操作系统的当前语言环境

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

将您的语言环境调整C为 Mongo 支持的 ,将解决问题:

export LC_ALL=C
mongod 

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

然而,这不是一个完美的解决方案:LC_ALL=C强制按字节顺序排序,而不是按区域设置敏感的字符排序,

MongoDB locale support is generally lacking. There is an open JIRA ticketdiscussing locale support.

通常缺乏 MongoDB 语言环境支持。有一个公开的 JIRA 票证讨论了语言环境支持。