Odoo Help

Welcome!

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.

1

How to access database of Odoo using pgAdmin III

By
Lakay lakay
on 9/11/14, 4:13 AM 17,773 views

Hi, 

i want to access Odoo database using pgAdmin3,

My scenario:

I have my Odoo running on ubuntu server in virtual box

I have installed pgAdmin3 on my localhost machine

when opening pgAdmin3 and selecting New Server Registration

this is my entry:

Name:    odoo

Host: 192.168.1.114     (this is the ip if you 'ifconfig' in the virtual box )

Port: 5432   (default didn't change anything)

Username: admin  (this is my usernane in odoo , admin account)

Password: admin (my ppassword in odoo)

Group: Servers

There is error after proceeding 

An error has occurred:

Error connecting to the server: FATAL:  password authentication failed for user "admin"
FATAL:  password authentication failed for user "admin"

what (username and password) should i enter there to connect to Odoo, i want to see records of tables there for example res_users

 

 

 

 

2

Temur

--Temur--
2894
| 6 5 7
Tbilisi, Georgia
--Temur--
Programmer
Temur
On 9/11/14, 11:00 AM

Your input to  pgadmin connection fields are all Ok (considering that username and password should be valid database username and password). I think your problem is that you haven't set an access rules in database configuration ( in your ubuntu server in virtual box)

you have to add access rule in config file of postgresql (file name is "pg_hba.conf", in 'Debian' full path is /etc/postgresql/9.1/main/pg_hba.conf ) for a host FROM which you are connecting to database

As you find "pg_hba.conf', you have to add access rule, something like:

host    <user name>   <ip/network>   md5

let's say your host ip, from which you are connecting is 200.200.200.200, and username is admin, then add similar line to pg_hba.conf:

host    admin    200.200.200.200/32   md5

- and do not forget about restarting of database server, once you've changed the config file.

 

For verify if you're using correct username and password, please consult "openerp-server.conf" file (in Debian it's full path is: "/etc/openerp/openerp-server.conf", you've to find its equivalent on Ubuntu), where 'db_user' property will show you correct username. As password, please use one that allows you copy/drop/create databases in openerp "Manage Databases" page (This page is accessible in openerp login page, before you login to openerp).

Temur
on 9/11/14, 11:37 AM

Hi, Temur i already added in my pg_hba.conf (in my ubuntu server)on the most bottom the line host openerp 192.168.1.114/24 md5 (this is my ip in the ubuntu server) also i added another line host all all 192.168.1.114/24 md5 (restart my server , same error) also in my openerp-server.conf in the debian this is my configuration [options] ; This is the password that allows database operations: ; admin_passwd = admin db_host = False db_port = False db_user = openerp db_password = False ~ ~ i tried to change the db_password with 'admin' and when i tried it on pgAdmin3 with Host=localhost username=openerp password =admin , same error also when i run the openerp-server the logs says that openerp: database hostname:localhost openerp:database port:5432 openerp:database user: myuser why is it contradicting to the one in the openerp-server.conf?

Lakay lakay
on 9/11/14, 10:04 PM

in reply to your comment that the password that must be used is the one in odoo wherein it allows you copy/drop/create database. that password is 'admin' but in my openerp-server.conf the db_password=False why is it? what should i write in the pgAdmin3?

Lakay lakay
on 9/11/14, 10:08 PM

hi, 1) USERNAME... ; admin_passwd = admin above line starts with ';' (semicolon symbol), so this line is just a comment. the real passwor may be different, you do NOT need to change this line. you should consult "openerp-server.conf" only for username and the 'db_user' property gives you correct username that you have to use in pgadmin. 2) PASSWORD... The correct password you have to use is that you allows database operations in Openerp "Manage Databases" page. this page is accessible from login page of openerp (when you connect to your Openerp from browser, you can go to "Manage Databases" page before you login. and there if you create new database, you have to type password. AFAIK you set this password when you install openerp.) make sure you know correct password by creating new database from that page. If so, you know the password that you have to use in pgadmin. 3) ACCESS RULE... you need to add access rule in "pg_hba.conf" in a host you are connecting to (your Ubuntu server) for a machine FROM WHERE you are trying to connect. 192.168.1.114/24 is wrong entry. 192.168.1.114 -is your Ubuntu server IP, you have to use in this rule IP of your machine instead (IP of machine you are connecting from). and one more thing, if you prefer to use network mask: /24, then replace last number by zero: 192.168.1.0/24 4) make sure you ping 192.168.1.114 (virtual box, Ubuntu) from your machine, and oppositely, ping your machine from the Ubuntu. also check the type of network connection of Ubuntu virtual machine in a settings of your Ubuntu virtual machine (in virtualbox settings of Ubunty appliance). consider to using "bridged connection" as network connection type, if you have trouble to ping. (attention, verify IP after this change, it may be changed also) SUMMARY: lets say 'A' is machine you are connecting from. 'B' is machine you are connecting to (it's your virtual box Ubuntu) Then consult "openerp-server.conf" on machine 'B' for username. Add access rule in "pg_hba.conf" on machine 'B' and in this rule use IP of machine 'A' (or network of machine 'A'). As I guess , your error is using IP of machine B, instead of IP of machine A. For verify password, create/drop database from openerp "Manage Databases" page, if you can do these operations, then password you need is that you are typing in this page.

Temur
on 9/12/14, 3:11 AM
in reply to your comment that you've tried on pgAdmin3 with Host=localhost username=openerp password =admin. Host=localhost -is wrong. You have to use Host = localhost ONLY IF you are runing pgAdmin3 on the same host as openerp and database servers. i.e. if you run your pgAdmin3 in your Ubuntu, together with openerp, then you can use Host=localhost . however your case is different, you are connecting to database from another machine, so you need Host = "IP OF MACHINE YOU ARE CONNECTING TO". As I already mentioned at start of my reply, your inputs to pgAdmin3 are all OK, if username and password are correct.

On 09/12/2014 06:08 AM, Lakay lakay wrote:
<blockquote cite="mid:1410487735.236974954605103.434429518844372-openerp-62485-forum.post@accounts.odoo.com" type="cite">

in reply to your comment that the password that must be used is the one in odoo wherein it allows you copy/drop/create database. that password is 'admin' but in my openerp-server.conf the db_password=False why is it? what should i write in the pgAdmin3?

--
Lakay lakay
Sent by OpenERP S.A. using Odoo about Forum Post False
Temur
on 9/12/14, 5:01 AM
0
Jose M
On 9/11/14, 4:39 AM

Name: Whatever you like, odoo is fine.

Host: This is localhost or 127.0.0.1 (is the same) not your IP

Port: 5432   (this is right)

Username: This is not your odoo's user, is the user you use to connect to the DB, you can see it in openerp-server.conf or in the log when you run openerp (Mine is openuser)

Password: The password of the user of the BD, not the one in odoo. (eg. password

Group: Servers

i have trouble in the password, what password are you referring? thanks for your answer.

Lakay lakay
on 9/11/14, 4:59 AM

Password: The password of the user of the BD, not the one in odoo. (eg. password) ->> you mean DB? i have many 5 users in my postgresql which one is it?

Lakay lakay
on 9/11/14, 5:01 AM

Password: The password of the user of the BD, not the one in odoo. (eg. password) ->> you mean DB? i have many 5 users in my postgresql which one is it?

Lakay lakay
on 9/11/14, 5:01 AM

Password: The password of the user of the BD, not the one in odoo. (eg. password) ->> you mean DB? i have many 5 users in my postgresql which one is it?

Lakay lakay
on 9/11/14, 5:01 AM

You can see openerp-server.conf -> db_password. Is the password of the user you use to acces database.

Jose M
on 9/11/14, 5:26 AM

the db_password there is set to false (db_password=False) i tried to change it like this (db_password=admin), and when i tried it to pgAdmin3 same error ? this is my configuration as shown below: [options] ; This is the password that allows database operations: ; admin_passwd = admin db_host = False db_port = False db_user = openerp db_password = False ~ Thanks for replying..

Lakay lakay
on 9/11/14, 10:10 PM

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

7 follower(s)

Stats

Asked: 9/11/14, 4:13 AM
Seen: 17773 times
Last updated: 10/27/16, 3:00 AM