【发布时间】:2019-05-18 13:28:21
【问题描述】:
我已经在 Ubuntu 18.04 上使用安装脚本 Odoo Install 安装了 Odoo12 服务器启动成功,在尝试创建第一个数据库时,出现以下错误。
数据库创建错误:编码“UTF8”与区域设置“en_US”不匹配详细信息:选择的 LC_CTYPE 设置需要编码“LATIN1”。
然后我在odoo 10上运行了以下脚本,它已经解决了之前的问题。 它是从 postgres 用户
运行的psql postgres -c "update pg_database set datallowconn = TRUE where datname = 'template0';"
psql template0 -c "update pg_database set datistemplate = FALSE where datname = 'template1';"
psql template0 -c "drop database template1;"
psql template0 -c "create database template1 with ENCODING = 'UTF-8' LC_CTYPE = 'en_US.utf8' LC_COLLATE = 'en_US.utf8' template = template0;"
psql template0 -c "update pg_database set datistemplate = TRUE where datname = 'template1';"
psql template1 -c "update pg_database set datallowconn = FALSE where datname = 'template0';"
由于问题仍然存在,我安装了 phpPgAdmin 并注意到编码仍然是 "Latin1" ;所以我删除了数据库,并使用相同的名称和相同的所有者从 phppgAdmin 界面手动创建了一个新数据库。 下面是 phpPgAdmin 的截图 phpPgAdmin shot screen
同样的问题仍未解决,错误如下所示。 Odoo Encoding Error message
注意这是在我的服务器上调用“locale”的返回。 locale status
【问题讨论】:
-
我也尝试在 /etc/odoo-server.conf 中添加 "db_template = template0" 并重新启动 postgresql 和 odoo 服务,但问题仍未解决。
-
我已经设法通过重新安装 Ubuntu 并传递 $ sudo locale-gen "en_US.UTF-8" $ sudo dpkg-reconfigure locales 并选择 en_US.UTF-8 作为我自己的问题来解决我自己的问题默认在安装 odoo 之前(以及在 PostgreSQL 之前)但我希望有人能回答我的问题,作为对社区的好处
标签: postgresql ubuntu encoding odoo phppgadmin