- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
尝试安装 opennms 时:
/usr/share/opennms/bin/install -l /usr/local/lib -dis
我得到错误:
ERROR: encoding UTF8 does not match locale en_US Detail: The chosen LC_CTYPE setting requires encoding LATIN1.
而且我不确定如何继续,因为我已经尝试了几种不同的方式来创建数据库(见下文)。
完整日志:
==============================================================================
OpenNMS Installer
==============================================================================
Configures PostgreSQL tables, users, and other miscellaneous settings.
- searching for jicmp:
- trying to load /usr/local/lib/libjicmp.so: NO
- trying to load /usr/lib/jni/libjicmp.so: OK
- searching for jicmp6:
- trying to load /usr/local/lib/libjicmp6.so: NO
- trying to load /usr/lib/jni/libjicmp6.so: OK
- searching for jrrd:
- trying to load /usr/local/lib/libjrrd.so: NO
- trying to load /usr/lib/jni/libjrrd.so: NO
- trying to load /usr/lib/jni/libjrrd.so: NO
- trying to load /usr/lib/jvm/jdk1.6.0_34/jre/lib/amd64/server/libjrrd.so: NO
- trying to load /usr/lib/jvm/jdk1.6.0_34/jre/lib/amd64/libjrrd.so: NO
- trying to load /usr/lib/jvm/jdk1.6.0_34/jre/../lib/amd64/libjrrd.so: NO
- trying to load /libjrrd.so: NO
- trying to load /usr/share/opennms/lib/libjrrd.so: NO
- trying to load /usr/share/opennms/lib/linux64/libjrrd.so: NO
- trying to load /usr/java/packages/lib/amd64/libjrrd.so: NO
- trying to load /usr/lib64/libjrrd.so: NO
- trying to load /lib64/libjrrd.so: NO
- trying to load /lib/libjrrd.so: NO
- trying to load /usr/lib/libjrrd.so: NO
- trying to load /usr/lib/jni/libjrrd.so: NO
- trying to load /usr/lib/libjrrd.so: NO
- trying to load /usr/local/lib/libjrrd.so: NO
- trying to load /opt/NMSjicmp/lib/32/libjrrd.so: NO
- trying to load /opt/NMSjicmp/lib/64/libjrrd.so: NO
- trying to load /opt/NMSjicmp6/lib/32/libjrrd.so: NO
- trying to load /opt/NMSjicmp6/lib/64/libjrrd.so: NO
- Failed to load the optional jrrd library.
- This error is not fatal, since jrrd is only required for optional features.
- For more information, see http://www.opennms.org/index.php/jrrd
- using SQL directory... /usr/share/opennms/etc
- using create.sql... /usr/share/opennms/etc/create.sql
* using 'postgres' as the PostgreSQL user for OpenNMS
* using 'opennms' as the PostgreSQL database name for OpenNMS
Exception in thread "main" org.opennms.core.schema.MigrationException: an error occurred creating the OpenNMS database
at org.opennms.core.schema.Migrator.createDatabase(Migrator.java:428)
at org.opennms.core.schema.Migrator.prepareDatabase(Migrator.java:444)
at org.opennms.install.Installer.install(Installer.java:236)
at org.opennms.install.Installer.main(Installer.java:949)
Caused by: org.postgresql.util.PSQLException: ERROR: encoding UTF8 does not match locale en_US
Detail: The chosen LC_CTYPE setting requires encoding LATIN1.
at org.postgresql.core.v3.QueryExecutorImpl.receiveErrorResponse(QueryExecutorImpl.java:2102)
at org.postgresql.core.v3.QueryExecutorImpl.processResults(QueryExecutorImpl.java:1835)
at org.postgresql.core.v3.QueryExecutorImpl.execute(QueryExecutorImpl.java:257)
at org.postgresql.jdbc2.AbstractJdbc2Statement.execute(AbstractJdbc2Statement.java:500)
at org.postgresql.jdbc2.AbstractJdbc2Statement.executeWithFlags(AbstractJdbc2Statement.java:374)
at org.postgresql.jdbc2.AbstractJdbc2Statement.execute(AbstractJdbc2Statement.java:366)
at org.opennms.core.schema.Migrator.createDatabase(Migrator.java:425)
... 3 more
数据库列表:
Name | Owner | Encoding | Collate | Ctype | Access privileges
-----------+----------+----------+---------+-------+-----------------------
postgres | postgres | LATIN1 | en_US | en_US |
rhq | rhqadmin | LATIN1 | en_US | en_US |
template0 | postgres | LATIN1 | en_US | en_US | =c/postgres +
| | | | | postgres=CTc/postgres
template1 | postgres | LATIN1 | en_US | en_US | =c/postgres +
| | | | | postgres=CTc/postgres
(4 rows)
我使用了以下 3 个 initdb 选项,但它们都不起作用
/usr/local/pgsql/bin/initdb -E UTF-8 --pgdata=/usr/local/pgsql/data
/usr/local/pgsql/bin/initdb -E LATIN1 --pgdata=/usr/local/pgsql/data
/usr/local/pgsql/bin/initdb -E en_US.UTF8 --pgdata=/usr/local/pgsql/data
此外,在使用 initdb
之前,我是否需要删除 /usr/local/pgsql/data
中的所有数据?
附加语言环境命令标准输出:
$语言环境
LANG=en_US
LANGUAGE=en_US:
LC_CTYPE="en_US"
LC_NUMERIC="en_US"
LC_TIME="en_US"
LC_COLLATE="en_US"
LC_MONETARY="en_US"
LC_MESSAGES="en_US"
LC_PAPER="en_US"
LC_NAME="en_US"
LC_ADDRESS="en_US"
LC_TELEPHONE="en_US"
LC_MEASUREMENT="en_US"
LC_IDENTIFICATION="en_US"
LC_ALL=
最佳答案
我结合了其他网站的两个解决方案(这个答案适用于 Ubuntu 服务器 12.04 和 PGSQL 9.1):
创建文件:nano/etc/profile.d/lang.sh
。
添加以下内容:
export LANGUAGE="en_US.UTF-8"
export LANG="en_US.UTF-8"
export LC_ALL="en_US.UTF-8"
保存文件
在当前 shell 实例中重新启动 shell 或手动运行所有导出命令
重新配置以便编码可以是 UTF8([从这里获取][1])
sudo su postgres
psql
update pg_database set datistemplate=false where datname='template1';
drop database Template1;
create database template1 with owner=postgres encoding='UTF-8'
lc_collate='en_US.utf8' lc_ctype='en_US.utf8' template template0;
update pg_database set datistemplate=true where datname='template1';
使用模板 1 创建数据库。
关于postgresql - 编码 UTF8 与语言环境 en_US 不匹配;所选的 LC_CTYPE 设置需要编码 LATIN1,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/13115692/
setlocale(LC_CTYPE, "de_DE.UTF8") 或 setlocale(LC_CTYPE, "de_DE.UTF-8") 带破折号还是不带破折号?我在答案中都看到了。 最佳答案 我
每当我在服务器中使用 SVN 时,我都会收到以下错误: svn: warning: cannot set LC_CTYPE locale svn: warning: environment varia
我需要从命令行读取数据并以 UTF-8 存储数据。为此,我的方法是通过检索当前区域设置来确定哪个字符集正在使用命令行 shell。 (当然,如果您看到更好的方法,请分享您的想法!) 尝试检测事件区域设
显然 PostgreSQL 从 8.4 版本开始允许每个数据库使用不同的语言环境所以我去文档阅读有关语言环境的信息 (http://www.postgresql.org/docs/8.4/static
我正在尝试在 PostgreSQL 9.4 中创建一个数据库 CREATE DATABASE "dbname" WITH ENCODING 'UTF8'; 但是得到 ERROR: encoding
在将多字节控制台应用程序转换为 Unicode 时,我遇到了一个奇怪的问题,其中 _tcprintf 和 WriteConsole 工作正常,但 _tprintf正在打印错误的字符... 我已经追溯到
使用 C,有没有办法查明是否设置了 LC_CTYPE?我正在重写 printf 并且我的 %lc 需要根据是否设置了区域设置以不同方式工作。 最佳答案 LC_CTYPE 是一个环境变量。您可以使用任何
关闭。这个问题不符合Stack Overflow guidelines .它目前不接受答案。 这个问题似乎不是关于 a specific programming problem, a softwar
当我的 PHP 脚本以 UTF-8 编码运行时,使用非 ASCII 字符,一些 PHP 函数如 strtolower() 不起作用。 我可以使用 mb_strtolower,但是这个脚本可以在各种不同
我正在尝试使用 CloudFormation 在 RDS 上创建 PostgreSQL 数据库。它说所有支持的参数都在 CreateDBInstance 中描述。 .到目前为止,我无法在那里或通过影响
升级 Windows 10 后,每当我启动 Rstudio 时,我都会收到以下警告消息。 启动期间 - 警告消息: 设置 LC_CTYPE= 失败 我目前正在运行 Microsoft R Open 版
已结束。此问题不符合 Stack Overflow guidelines .它目前不接受答案。 这个问题似乎与 a specific programming problem, a software a
必须在 Homebrew 框架内迁移 postgresql 集群(按照此处的说明), https://gist.github.com/cjolly/2870054命令迁移失败 pg_upgrade -
所以我在浏览 GeoDjango 教程时遇到了这个错误消息: postgres@lucid32:~$ createdb -E UTF8 template_postgis createdb: datab
我需要将这些参数从 English_United States.1252 更改为Portuguese_Brazil.1252 有人知道该怎么做吗?谢谢。 最佳答案 创建数据库时需要设置collat
来自此链接 http://wiki.postgresql.org/wiki/Todo:Collate和 http://www.postgresql.org/docs/9.1/static/collat
尝试安装 opennms 时: /usr/share/opennms/bin/install -l /usr/local/lib -dis 我得到错误: ERROR: encoding UTF8 do
我想在我的笔记本电脑 Mac OS X 版本 10.7.3 上安装 R 我下载了最后一个版本,双击它并安装了它,当我启动时出现以下错误,我在互联网上搜索但无法解决问题,任何帮助将不胜感激 错误是 Du
我是 vagrant 的初学者。我尝试使用 vagrant 在我的计算机上创建一个虚拟机 (cent os 6)。当我运行 vagrant ssh 时,它会打印此警告: -bash: warning:
我是一名优秀的程序员,十分优秀!