loading...

sqlcmd's error: "locale::facet::_S_create_c_locale name not valid"

nabbisen profile image Heddi Nabbisen Updated on ・1 min read

MS SQL Server on Debian (3 Part Series)

1) Microsoft SQL Server 2017 on Debian 2) Microsoft SQL Server Client on Debian 3) sqlcmd's error: "locale::facet::_S_create_c_locale name not valid"

If the locale of your OS is NOT English, you might meet the error below, when the installation of sqlcmd, a Microsoft SQL Server 2017's client command line tool, has finished and you try to use it.

$ /opt/mssql-tools/bin/sqlcmd
terminate called after throwing an instance of 'std::runtime_error'
  what():  locale::facet::_S_create_c_locale name not valid

Besides, you can see your locale this way:

$ locale
LANG=ja_JP.UTF-8
LANGUAGE=
LC_CTYPE="ja_JP.UTF-8"
LC_NUMERIC="ja_JP.UTF-8"
LC_TIME="ja_JP.UTF-8"
LC_COLLATE="ja_JP.UTF-8"
LC_MONETARY="ja_JP.UTF-8"
LC_MESSAGES="ja_JP.UTF-8"
LC_PAPER="ja_JP.UTF-8"
LC_NAME="ja_JP.UTF-8"
LC_ADDRESS="ja_JP.UTF-8"
LC_TELEPHONE="ja_JP.UTF-8"
LC_MEASUREMENT="ja_JP.UTF-8"
LC_IDENTIFICATION="ja_JP.UTF-8"
LC_ALL=

They are my Debian's.

Well, let's try to solve the problem.
* There is an easier way in the post comment. Thank you, scientronic92 :)

Add a line to the bottom of /etc/locale.gen like this:

+ en_US.UTF-8 UTF-8

Then run:

$ sudo /usr/sbin/locale-gen

I hope your problem is solved after the process :)

Thank you for your reading.
Happy computing.

MS SQL Server on Debian (3 Part Series)

1) Microsoft SQL Server 2017 on Debian 2) Microsoft SQL Server Client on Debian 3) sqlcmd's error: "locale::facet::_S_create_c_locale name not valid"

Posted on May 23 '19 by:

nabbisen profile

Heddi Nabbisen

@nabbisen

An ICT designer/developer and a security monk. "With a cool brain and a warm heart", I am challenging unsolved problems in our society. I use OpenBSD/Rust/etc.

Discussion

markdown guide
 

Thank you for sharing. But I found this helpful commands:

export LANG=en_US.UTF-8
locale-gen en_US.UTF-8

It helped me with using mssql-tools.

 

Dear scientronic92,
Thank you for your comment.
That is an easier and simpler.
I have updated my post to add the link :)