sqlcmd failed due to "locale::facet::_S_create_c_locale name not valid"
- Databases and storage
- Published
- 1 min read
- @nabbisen
Table of contents
Intro Intro
If the locale of your OS is NOT English, you might meet the error below, when the installation of sqlcmd (opens in a new tab), a Microsoft (opens in a new tab) SQL Server 2017 (opens in a new tab)’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 (opens in a new tab)’s.
Solution Solution
Let’s try to solve the problem.
Case 1: With export (recommended) Case 1: With export (recommended)
$ export LANG=en_US.UTF-8
Then run:
$ sudo locale-gen
* Thanks to scientronic92 (opens in a new tab). His comments (opens in a new tab) helped me a lot.
Case 2: With locale.gen editted Case 2: With locale.gen editted
Add a line to the bottom of /etc/locale.gen like this:
+ en_US.UTF-8 UTF-8
Then run:
$ sudo locale-gen
Outro Outro
I hope your problem is solved after the process :)
Thank you for your reading. Happy computing.
More on: Run a database on your server
-
MariaDB is one of the most popular relational database management systems (RDBMS), forked from MySQL by some of the original developers.
-
OpenBSD gives us good documentation as a series of the project.
-
OpenBSD gives us good documentation as a series of the project.
Scqr [secureal]
Scqr [secureal]: the engineering practice of Reflerd Inc. (opens in a new tab)
Comments and feedback are welcome.