How to deal resolve problem with locale settings — mongo 3.2 and CentOS

Vuong Tran
1 min readNov 17, 2016

--

New versions of MongoDB started to throw the following error on my CentOS 6.8 server:

“Failed global initialization: BadValue Invalid or no user locale set. Please ensure LANG and/or LC_* environment variables are set correctly.”

Try to fix it, open file/etc/default/locale and add something like this

LANG=“en_US.UTF-8”
LANGUAGE=“en_US”
LC_ALL=“en_US.UTF-8”

Then restart the shell session and run $ mongo agian— it should start without previous error.

That’s it! Happy coding.

--

--