This question has been flagged
14 Replies
96046 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

 

 

 

 

Avatar
Discard
Best Answer

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.

 

Avatar
Discard

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).

Author

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?

Author

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?

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.

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
Best Answer

Hello Lakay,

this forum can help you


https://stackoverflow.com/questions/10845998/i-forgot-the-password-i-entered-during-postgres-installation

Avatar
Discard
Best Answer

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

Avatar
Discard
Author

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

Author

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?

Author

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?

Author

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?

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

Author

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..