Odoo Help


This community is for beginners and experts willing to share their Odoo knowledge. It's not a forum to discuss ideas, but a knowledge base of questions and their answers.


DataError: new encoding (UTF8) is incompatible with the encoding of the template database (SQL_ASCII)

on 5/14/14, 5:49 AM 16,698 views

Hi u all!

I'm trying to install openerp in a server which is running a mysql DB.

When I'm installing it, it appears a list of errors and i supose it's because of my existing DB. Can i do something to fix it or cannot i use my existing DB?

OpenERP Server Error

Traceback (most recent call last): File "/opt/openerp/v7/web/addons/web/http.py", line 204, in dispatch response["result"] = method(self, **self.params) File "/opt/openerp/v7/web/addons/web/controllers/main.py", line 774, in create params['create_admin_pwd']) File "/opt/openerp/v7/web/addons/web/session.py", line 30, in proxy_method result = self.session.send(self.service_name, method, *args) File "/opt/openerp/v7/web/addons/web/session.py", line 103, in send raise xmlrpclib.Fault(openerp.tools.ustr(e), formatted_info)

Server Traceback (most recent call last): File "/opt/openerp/v7/web/addons/web/session.py", line 89, in send return openerp.netsvc.dispatch_rpc(service_name, method, args) File "/opt/openerp/v7/server/openerp/netsvc.py", line 296, in dispatch_rpc result = ExportService.getService(service_name).dispatch(method, params) File "/opt/openerp/v7/server/openerp/service/web_services.py", line 122, in dispatch return fn(params) File "/opt/openerp/v7/server/openerp/service/web_services.py", line 167, in exp_create_database self._create_empty_database(db_name) File "/opt/openerp/v7/server/openerp/service/web_services.py", line 136, in _create_empty_database cr.execute("""CREATE DATABASE "%s" ENCODING 'unicode' TEMPLATE "%s" """ % (name, chosen_template)) File "/opt/openerp/v7/server/openerp/sql_db.py", line 161, in wrapper return f(self, *args, *kwargs) File "/opt/openerp/v7/server/openerp/sql_db.py", line 226, in execute res = self._obj.execute(query, params) DataError: new encoding (UTF8) is incompatible with the encoding of the template database (SQL_ASCII) HINT: Use the same encoding as in the template database, or use template0 as template.

Thank you very much

Ivan Yelizariev
On 9/19/14, 12:46 AM

I copy-paste solution from Tauras link.


In console run psql:

sudo -u postgres psql postgres

then in psql console execute sequence of commands:


update pg_database set datallowconn = TRUE where datname = 'template0';
\c template0
update pg_database set datistemplate = FALSE where datname = 'template1';
drop database template1;
create database template1 with template = template0 encoding = 'UTF8';
update pg_database set datistemplate = TRUE where datname = 'template1';
\c template1
update pg_database set datallowconn = FALSE where datname = 'template0';

(press Ctrl-D to quit from psql)



Thanks it's worked for me.

on 1/18/16, 12:18 AM
Tauras Paliulis
On 5/19/14, 7:57 AM

Check this out. It helped me http://www.openerp.bg/%D0%B1%D0%BB%D0%BE%D0%B3/item/163-%D0%BF%D1%80%D0%BE%D0%BC%D1%8F%D0%BD%D0%B0-%D0%BD%D0%B0-postgresql-default-template0-%D0%BD%D0%B0-utf8-encoding

Your Answer

Please try to give a substantial answer. If you wanted to comment on the question or answer, just use the commenting tool. Please remember that you can always revise your answers - no need to answer the same question twice. Also, please don't forget to vote - it really helps to select the best questions and answers!

About This Community

This community is for professionals and enthusiasts of our products and services. Read Guidelines

Question tools

1 follower(s)


Asked: 5/14/14, 5:49 AM
Seen: 16698 times
Last updated: 10/28/15, 2:38 PM